Skip to content

Commit

Permalink
minor updates to the labs
Browse files Browse the repository at this point in the history
* Update readme.md

* Changed in labs of keyvault

* Changes in Launchdarkly

* click on y for geo-redundancy

* Ansible minimal changes

Co-authored-by: Suraj <[email protected]>
  • Loading branch information
surajshenoy and Suraj authored Dec 30, 2022
1 parent 87bc5d6 commit af57d9c
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 13 deletions.
4 changes: 3 additions & 1 deletion labs/vstsextend/ansible/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ To create and provision the resources in Azure with Ansible, we need to have a L

`tenant=<azure serviceprincipal-tenant>`

1. Run `nano .bashrc` and insert the following text into **.bashrc**. Press **Ctrl+O** to save the file and **Ctrl+X** to exit from the text editor.
1. Run `nano ~/.bashrc` and insert the following text into **.bashrc**. Press **Ctrl+O** to save the file and **Ctrl+X** to exit from the text editor.

`PATH=$PATH:$HOME/.local/bin:$HOME/bin`

Expand All @@ -151,6 +151,8 @@ To create and provision the resources in Azure with Ansible, we need to have a L

>Note: Replace **azureuser** with your VM username in the above command.

>When asked for the password give the password of the VM that has been noted

![](images/sshkeys.png)

1. In the next task, you need SSH private key to created SSH endpoint in Azure DevOps service. Run the following command to get the private key. Copy the private key to notepad.
Expand Down
Binary file added labs/vstsextend/azurekeyvault/images/Addrole.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 28 additions & 7 deletions labs/vstsextend/azurekeyvault/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ We will create one manually using the Azure CLI. If you do already have a servic

![](images/azureserviceprincipal.png)

1. Now, we need to grant contributor permission to service principal. For that, go to **Subscriptions** section in Azure portal

![](images/subscription.png)

1. In left pane, select **Access control(IAM)** and then click on **Add role assignment** option that is available under Grant access to this resource section.

![](images/addrole.png)

1. Select **Contributor** and then click on **Next**

![](images/contributor.png)

1. Now, using **+ Select Members** select the service principal that has been craeted and click on Next. **Review + assign** now to finish role assignment.

![](images/role-assignment.png)

1. Enter the following command to get Azure SubscriptionID and copy the subscription ID and name to notepad.

`az account show`
Expand All @@ -73,23 +89,28 @@ Next, we will create a key vault in Azure. For this lab scenario, we have a node

Because data in Key Vaults are sensitive and business critical, you need to secure access to your key vaults by allowing only authorized applications and users. To access the data from the vault, you will need to provide read (Get) permissions to the service principal that you will be using for authentication in the pipeline.

1. Select **Access policy** and then select **+ Add Access Policy** to setup a new policy.
1. Click on Next to change **Access policy** and then select **+ Create** to setup a new policy.

![](images/accesspolicy.png)

![](images/kv_t2_s5.png)

1. You will need specify the permission that you intend to grant the application. This can be permissions to manage the keys and data(secrets). In any case, applications can access the key vault in two ways:

* User + Application access: Access is granted to specific user who can then be allowed to use any application or can be restricted to use a specific application.

* Application-only access: Access is granted to the application which can be run as a daemon service or background job.

1. Next, we will select the permission to be granted. For now, we will provide **read-only** permissions (Get, List) to secrets only.

![](images/providingaccess.png)

1. Select the **Select principal** and search for the security principal that you created earlier and select it. You can search by name or ID of the principal.

![](images/select-sp.png)
![](images/spselection.png)

1. Next, we will select the permission to be granted. For now, we will provide **read-only** permissions (Get, List) to secrets only.
1. In **Application (optional)** section click on **Next** since we have chosen the service principal and then create the access policy.

![](images/application-opt.png)

![](images/kv_t2_s8.png)

1. Click **Review + create** to close the open blades and select **Create** to create the vault.

Expand All @@ -109,7 +130,7 @@ Now, lets go to the Azure DevOps project that you provisioned using the [Azure D

1. To trigger a build, choose the **SmartHotel-CouponManagement-CI** definition and then **Run Pipeline** to manually queue it.

![](images/kv_t3_s3.png)
![](images/createbuild.png)

{% include note.html content= "We also have a YAML build pipeline if that's something you're interested in. To proceed through the YAML pipeline, choose **SmartHotel-CouponManagement-CI-YAML** and click **Edit**. If you utilize the YAML pipeline, make sure to update the **SmartHotel-CouponManagement-CD** release definition's artifact link." %}

Expand Down
3 changes: 2 additions & 1 deletion labs/vstsextend/kubernetes/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ The following azure resources need to be configured for this lab:
```bash
az sql db create -g akshandsonlab -s <unique-sqlserver-name> -n mhcdb --service-objective S0
```
{% include important.html content= "Enter a unique SQL server name. Since the Azure SQL Server name does not support **UPPER** / **Camel** casing naming conventions, use lowercase for the ***SQL Server Name*** field value." %}
{% include important.html content= "Enter a unique SQL server name. Since the Azure SQL Server name does not support **UPPER** / **Camel** casing naming conventions, use lowercase for the ***SQL Server Name*** field value.
Press y in case if the prompt is asking for default geo-redundant storage" %}
1. The following components - **Container Registry**, **Kubernetes Service**, **SQL Server** along with **SQL Database** are deployed. Access each of these components individually and make a note of the details which will be used in Exercise 1.
![Deploy to Azure](images/azurecomponents.png)
Expand Down
Binary file modified labs/vstsextend/launchdarkly/images/createfeatureflag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions labs/vstsextend/launchdarkly/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ In this lab, you will learn

1. You’ve created a flag named **Member Portal**. Assume that you want to use this flag to determine the visibility of the **Member Portal** feature in your ASP.NET MVC web app. Now your dashboard looks as below

![](images/dashboard.png)
![](images/dashboard1.png)

1. To integrate LaunchDarkly into your application, you need an SDK key. If you go the **Account settings** in the portal, you see that there are two predefined environments: production and test. You can use the production environment SDK key for this project. Copy SDK key and paste it into your notepad. You need this in the following exercise.
1. To integrate LaunchDarkly into your application, you need an SDK key. If you go the **Account settings** in the portal, and navigate to **Projects** you see that there are two predefined environments: production and test. You can use the production environment SDK key for this project. Copy SDK key and paste it into your notepad. You need this in the following exercise.

![](images/sdkkey.png)

Expand Down
Binary file added labs/vstsextend/terraform/images/ci-pipeline1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/vstsextend/terraform/images/copyfiles1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions labs/vstsextend/terraform/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ In this lab, you will use PartsUnlimited which is an example eCommerce website d

1. Your build pipeline will look like as below. This CI pipeline has tasks to compile .Net Core project. The `dotnet` tasks in the pipeline will restore dependencies, build, test and publish the build output into a zip file (package) which can be deployed to a web application.

![](images/ci-pipeline.png)
![](images/ci-pipeline1.png)

For more guidance on how to build .Net Core projects with Azure Pipelines see [here](https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=vsts&tabs=designer#build-your-project).

1. In addition to the application build, we need to publish terraform files to build artifacts so that it will be available in CD pipeline. So we have added **Copy files** task to copy Terraform file to Artifacts directory.

![](images/copyfiles.png)
![](images/copyfiles1.png)

1. Now click **Queue** to trigger the build. Once the build succeeds, verify that the artifacts have **Terraform** folder and **PartsUnlimitedwebsite.zip** file in the drop.

Expand Down

0 comments on commit af57d9c

Please sign in to comment.