Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit d05fa12

Browse files
authored
task 3
1 parent 4c3397e commit d05fa12

3 files changed

Lines changed: 57 additions & 30 deletions

File tree

Instructions/Labs/AZ400_M07_Integrating_Azure_Key_Vault_with_Azure_DevOps.md

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ In this task, you will create an **eShopOnWeb** Azure DevOps project to be used
7272

7373
In this task you will import the eShopOnWeb Git repository that will be used by several labs.
7474

75-
1. On your lab computer, in a browser window open your Azure DevOps organization and the previoulsy created **eShopOnWeb** project. Click on **Repos>Files** , **Import**. On the **Import a Git Repository** window, paste the following URL https://github.com/MicrosoftLearning/eShopOnWeb.git and click **Import**:
75+
1. On your lab computer, in a browser window open your Azure DevOps organization and the previoulsy created **eShopOnWeb** project. Click on **Repos>Files** , **Import**. On the **Import a Git Repository** window, paste the following URL https://github.com/MicrosoftLearning/eShopOnWeb.git and click on **Import**:
7676

7777
![Import Repository](images/import-repo.png)
7878

@@ -102,7 +102,7 @@ You will need a service principal to deploy Azure resources from Azure Pipeline
102102
A service principal is automatically created by Azure Pipeline when you connect to an Azure subscription from inside a pipeline definition or when you create a new service connection from the project settings page (automatic option). You can also manually create the service principal from the portal or using Azure CLI and re-use it across projects.
103103

104104
1. From the lab computer, start a web browser, navigate to the [**Azure Portal**](https://portal.azure.com), and sign in with the user account that has the Owner role in the Azure subscription you will be using in this lab and has the role of the Global Administrator in the Azure AD tenant associated with this subscription.
105-
1. In the Azure portal, click the **Cloud Shell** icon, located directly to the right of the search textbox at the top of the page.
105+
1. In the Azure portal, click on the **Cloud Shell** icon, located directly to the right of the search textbox at the top of the page.
106106
1. If prompted to select either **Bash** or **PowerShell**, select **Bash**.
107107

108108
>**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and select **Create storage**.
@@ -151,11 +151,11 @@ From the lab computer, start a web browser, navigate to the Azure DevOps **eShop
151151
152152
1. On the **Where is your code?** window, select **Azure Repos Git (YAML)** and select the **eShopOnWeb** repository.
153153
154-
1. On the **Configure** section, choose **Existing Azure Pipelines YAML file**. Provide the following path **/.ado/main-ci-containers-compose.yml** and click **Continue**.
154+
1. On the **Configure** section, choose **Existing Azure Pipelines YAML file**. Provide the following path **/.ado/main-ci-containers-compose.yml** and click on **Continue**.
155155
156156
![Select Pipeline](images/select-ci-container-compose.png)
157157
158-
1. In the YAML pipeline definition, customize your Resource Group name by replacing **NAME** on **att-az400-ewebshop-NAME** and replace **YOUR-SUBSCRIPTION-ID** with the your own Azure subscriptionId.
158+
1. In the YAML pipeline definition, customize your Resource Group name by replacing **NAME** on **AZ400-EWebShop-NAME** and replace **YOUR-SUBSCRIPTION-ID** with the your own Azure subscriptionId.
159159
160160
1. Click on **Save and Run** and wait for the pipeline to execute succesfully.
161161
@@ -164,64 +164,91 @@ From the lab computer, start a web browser, navigate to the Azure DevOps **eShop
164164
- **PowerShell** task take the bicep output (acr login server) and creates pipeline variable.
165165
- **DockerCompose** task builds and pushes the container images for eShopOnWeb.
166166
167-
1. Once the execution is finished, on the Azure Portal and defined Resource Group, you should find an Azure Container Registry with the created container images **eshoppublicapi** and **eshopwebmvc**. You will only use **eshopwebmvc** on the deploy phase.
167+
1. Your pipeline will take a name based on the project name. Lets rename it for identifying the pipeline better. Go to **Pipelines>Pipelines** and click on the recently created pipeline. Click on the ellipsis and **Rename/Remove** option. Name it **main-ci-docker-compose** and click on **Save**.
168+
169+
170+
1. Once the execution is finished, on the Azure Portal and defined Resource Group, you should find an Azure Container Registry (ACR) with the created container images **eshoppublicapi** and **eshopwebmvc**. You will only use **eshopwebmvc** on the deploy phase.
168171
169172
![Container Images in ACR](images/azure-container-registry.png)
170173
174+
1. Click on **Access Keys** and copy the **password** value, it will be used in the following task, as we will keep it in Azure Key Vault.
175+
176+
![ACR password](images/acr-password.png)
177+
171178
172179
#### Task 2: Create an Azure Key vault
173180
174181
In this task, you will create an Azure Key vault by using the Azure portal.
175182
176-
For this lab scenario, we have an app that connects to a MySQL database. We intend to store the password for the MySQL database as a secret in the key vault.
183+
For this lab scenario, we will have a Azure Container Instance (ACI) that pull and runs a container image stored in Azure Container Registry (ACR). We intend to store the password for the ACR as a secret in the key vault.
177184
178-
1. In the Azure portal, in the **Search resources, services, and docs** text box, type **Key vaults** and press the **Enter** key.
179-
1. On the **Key vaults** blade, click **+ Create**.
180-
1. On the **Basics** tab of the **Create key vault** blade, specify the following settings and click **Next: Access policy**:
185+
1. In the Azure portal, in the **Search resources, services, and docs** text box, type **Key vault** and press the **Enter** key.
186+
1. Select **Key vault** blade, click on **Create>Key Vault**.
187+
1. On the **Basics** tab of the **Create key vault** blade, specify the following settings and click on **Next**:
181188
182189
| Setting | Value |
183190
| --- | --- |
184191
| Subscription | the name of the Azure subscription you are using in this lab |
185-
| Resource group | the name of a new resource group **az400m07l01-RG** |
186-
| Key vault name | any unique valid name |
192+
| Resource group | the name of a new resource group **AZ400-EWebShop-NAME** |
193+
| Key vault name | any unique valid name, like **ewebshop-kv-NAME** (replace NAME) |
187194
| Region | an Azure region close to the location of your lab environment |
188195
| Pricing tier | **Standard** |
189196
| Days to retain deleted vaults | **7** |
190197
| Purge protection | **Disable purge protection** |
191198
192-
1. On the **Access policy** tab of the **Create key vault** blade, click **+ Add Access Policy** to setup a new policy.
193-
194-
> **Note**: 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.
199+
1. On the **Access policy** tab of the **Create key vault** blade, on the **Access Policy** section, click on **+ Create** to setup a new policy.
195200
196-
1. On the **Add access policy** blade, click the **None selected** link directly under the **Select principal** label.
197-
1. On the **Principal** blade, search for the security principal that you created in the previous exercise, select it, and then click **Select**.
201+
> **Note**: 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/List) permissions to the previously created service principal that you will be using for authentication in the pipeline.
198202
199-
> **Note**: You can search by name or ID of the principal.
203+
1. On the **Permission** blade, check **Get** and **List** permissions below **Secret Permission**. Click on **Next**.
204+
1. on the **Principal** blade, search for the previosly created Service Principal, either using the Id or Name given. Click on **Next** and **Next** again.
205+
1. On the **Review + create** blade, click on **Create**
200206
201-
1. Back on the **Add access policy** blade, in the **Secret permissions** drop down list, select checkboxes next to the **Get** and **List** permissions and then click **Add**.
202-
1. Back on the **Access policy** tab of the **Create key vault** blade, click **Review + create** and, on the **Review + create** blade, click **Create**.
207+
1. Back on the **Create a Key Vault** blade, click on **Review + Create > Create**
203208
204209
> **Note**: Wait for the Azure Key vault to be provisioned. This should take less than 1 minute.
205210
206-
1. On the **Your deployment is complete** blade, click **Go to resource**.
207-
1. On the Azure Key vault blade, in the vertical menu on the left side of the blade, in the **Settings** section, click **Secrets**.
208-
1. On the **Secrets** blade, click **Generate/Import**.
209-
1. On the **Create a secret** blade, specify the following settings and click **Create** (leave others with their default values):
211+
1. On the **Your deployment is complete** blade, click on **Go to resource**.
212+
1. On the Azure Key vault blade, in the vertical menu on the left side of the blade, in the **Objects** section, click on **Secrets**.
213+
1. On the **Secrets** blade, click on **Generate/Import**.
214+
1. On the **Create a secret** blade, specify the following settings and click on **Create** (leave others with their default values):
210215
211216
| Setting | Value |
212217
| --- | --- |
213218
| Upload options | **Manual** |
214-
| Name | **sqldbpassword** |
215-
| Value | any valid MySQL password value |
219+
| Name | **acr-secret** |
220+
| Value | ACR access password from previous task |
221+
222+
223+
#### Task 3: Create a Variable Group connected to Azure Key Vault
224+
225+
In this task, you will create a Variable Group in Azure DevOps that will retrieve the ACR password secret from Key Vault using the Service Connection (Service Principal)
226+
227+
1. On your lab computer, start a web browser and navigate to the Azure DevOps project **eShopOnWeb**.
228+
229+
1. In the vertical navigational pane of the of the Azure DevOps portal, select **Pipelines>Library**. Click on **+ Variable Group**.
230+
231+
1. On the **New variable group** blade, specify the following settings:
232+
233+
| Setting | Value |
234+
| --- | --- |
235+
| Variable Group Name | **eshopweb-vg** |
236+
| Link secrets from Azure KV ... | **enable** |
237+
| Azure subscription | **Available Azure service connection > Azure subs** |
238+
| Key vault name | Your key vault name|
239+
240+
1. Under **Variables**, click on **+ Add** and select the **acr-secret** secret. Click on **OK**.
241+
1. Click on **Save**.
242+
243+
![Variable Group create](images/vg-create.png)
244+
245+
246+
216247
217248
218-
#### Task 3: Check the Azure Pipeline
219249
220-
In this task, you will configure the Azure Pipeline to retrieve the secret from the Azure Key vault.
221250
222-
1. On your lab computer, start a web browser and navigate to the Azure DevOps project **Integrating Azure Key Vault with Azure DevOps** you created in the previous exercise.
223-
1. In the vertical navigational pane of the of the Azure DevOps portal, select **Pipelines** and verify that the **Pipelines** pane is displayed.
224-
1. On the **Pipelines** pane, click the entry representing the **SmartHotel-CouponManagement-CI** pipeline. Click on **Edit**.
251+
1. On the **Pipelines** pane, click on the entry representing the **SmartHotel-CouponManagement-CI** pipeline. Click on **Edit**.
225252
2. On the pipeline definition, make sure the **Pipeline** > **Agent Specification** is **ubuntu 18.04**. Click **Save and Queue** > **Queue** > **Run** to trigger a build.
226253
3. In the vertical navigational pane of the of the Azure DevOps portal, in the **Pipelines** section, select **Releases**.
227254
4. On the **SmartHotel-CouponManagement-CD** pane, click **Edit** in the upper right corner.
225 KB
Loading
181 KB
Loading

0 commit comments

Comments
 (0)