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

Commit 9c56b91

Browse files
committed
Update instructions and remove tasks
1 parent 25ecb4c commit 9c56b91

1 file changed

Lines changed: 17 additions & 81 deletions

File tree

Instructions/Labs/AZ400_M04_L10_Integrate_Azure_Key_Vault_with_Azure_DevOps.md

Lines changed: 17 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@ Azure Key Vault provides secure storage and management of sensitive data, such a
2020
In this lab, you will see how you can integrate Azure Key Vault with an Azure Pipelines by using the following steps:
2121

2222
- Create an Azure Key Vault to store a ACR password as a secret.
23-
- Create an Azure Service Principal to provide access to secrets in the Azure Key Vault.
24-
- Configure permissions to allow the Service Principal to read the secret.
23+
- Provide access to secrets in the Azure Key Vault.
24+
- Configure permissions to read the secret.
2525
- Configure pipeline to retrieve the password from the Azure Key Vault and pass it on to subsequent tasks.
2626

2727
## Objectives
2828

2929
After you complete this lab, you will be able to:
3030

31-
- Create a Microsoft Entra service principal.
3231
- Create an Azure Key Vault.
32+
- Retrieve a secret from Azure Key Vault in an Azure DevOps pipeline.
33+
- Use the secret in a subsequent task in the pipeline.
34+
- Deploy a container image to Azure Container Instance (ACI) using the secret.
3335

3436
## Estimated timing: 40 minutes
3537

3638
## Instructions
3739

38-
### Exercise 0: Configure the lab prerequisites
40+
### Exercise 0: (skip if done) Configure the lab prerequisites
3941

4042
In this exercise, you will set up the prerequisites for the lab, which consist of a new Azure DevOps project with a repository based on the [eShopOnWeb](https://github.com/MicrosoftLearning/eShopOnWeb).
4143

@@ -70,69 +72,9 @@ In this task you will import the eShopOnWeb Git repository that will be used by
7072

7173
### Exercise 1: Setup CI pipeline to build eShopOnWeb container
7274

73-
Setup CI YAML pipeline for:
75+
In this exercise, you will create a CI pipeline that builds and pushes the eShopOnWeb container images to an Azure Container Registry (ACR). The pipeline will use Docker Compose to build the images and push them to the ACR.
7476

75-
- Creating an Azure Container Registry to keep the container images
76-
- Using Docker Compose to build and push **eshoppublicapi** and **eshopwebmvc** container images. Only **eshopwebmvc** container will be deployed.
77-
78-
#### Task 1: (skip if done) Create a Service Principal
79-
80-
In this task, you will create a Service Principal by using the Azure CLI, which will allow Azure DevOps to:
81-
82-
- Deploy resources on your Azure subscription.
83-
- Have read access on the later created Key Vault secrets.
84-
85-
> **Note**: If you do already have a Service Principal, you can proceed directly to the next task.
86-
87-
You will need a Service Principal to deploy Azure resources from Azure Pipelines. Since we are going to retrieve secrets in a pipeline, we will need to grant permission to the service when we create the Azure Key Vault.
88-
89-
A Service Principal is automatically created by Azure Pipelines, 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.
90-
91-
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 Microsoft Entra tenant associated with this subscription.
92-
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.
93-
1. If prompted to select either **Bash** or **PowerShell**, select **Bash**.
94-
95-
> **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**.
96-
97-
1. From the **Bash** prompt, in the **Cloud Shell** pane, run the following commands to retrieve the values of the Azure subscription ID and subscription name attributes:
98-
99-
```bash
100-
az account show --query id --output tsv
101-
az account show --query name --output tsv
102-
```
103-
104-
> **Note**: Copy both values to a text file. You will need them later in this lab.
105-
106-
1. From the **Bash** prompt, in the **Cloud Shell** pane, run the following command to create a Service Principal (replace the **myServicePrincipalName** with any unique string of characters consisting of letters and digits) and **mySubscriptionID** with your Azure subscriptionId :
107-
108-
```bash
109-
az ad sp create-for-rbac --name myServicePrincipalName \
110-
--role contributor \
111-
--scopes /subscriptions/mySubscriptionID
112-
```
113-
114-
> **Note**: The command will generate a JSON output. Copy the output to text file. You will need it later in this lab.
115-
116-
1. Next, from the lab computer, start a web browser, navigate to the Azure DevOps **eShopOnWeb** project. Click on **Project Settings > Service Connections (under Pipelines)** and **New Service Connection**.
117-
118-
![Screenshot of the new service connection option.](images/new-service-connection.png)
119-
120-
> **Note**: If there are no Service Connections previously created on the page, the service connection creation button is located in the center of the page and has the label **Create service connection**
121-
122-
1. On the **New service connection** blade, select **Azure Resource Manager** and **Next** (may need to scroll down).
123-
124-
1. Then choose **Service Principal (manual)** and click on **Next**.
125-
126-
1. Fill in the empty fields using the information gathered during previous steps:
127-
- Subscription Id and Name.
128-
- Service Principal Id (appId), Service principal key (password) and Tenant ID (tenant).
129-
- In **Service connection name** type **`azure subs`**. This name will be referenced in YAML pipelines when needing an Azure DevOps Service Connection to communicate with your Azure subscription.
130-
131-
![Screenshot of the Azure service connection panel.](images/azure-service-connection.png)
132-
133-
1. Click on **Verify and Save**.
134-
135-
#### Task 2: Setup and Run CI pipeline
77+
#### Task 1: Setup and Run CI pipeline
13678

13779
In this task, you will import an existing CI YAML pipeline definition, modify and run it. It will create a new Azure Container Registry (ACR) and build/publish the eShopOnWeb container images.
13880

@@ -210,7 +152,7 @@ For this lab scenario, we will have a Azure Container Instance (ACI) that pulls
210152

211153
#### Task 3: Create a Variable Group connected to Azure Key Vault
212154

213-
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).
155+
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 created previously.
214156

215157
1. On your lab computer, start a web browser and navigate to the Azure DevOps project **eShopOnWeb**.
216158

@@ -259,22 +201,16 @@ In this task, you will import a CD pipeline, customize it, and run it for deploy
259201

260202
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 **eshoponweb-cd-aci** and click on **Save**.
261203

262-
### Exercise 2: Remove the Azure lab resources
263-
264-
In this exercise, you will remove the Azure resources provisioned in this lab to eliminate unexpected charges.
265-
266-
> **Note**: Remember to remove any newly created Azure resources that you no longer use. Removing unused resources ensures you will not see unexpected charges.
267-
268-
#### Task 1: Remove the Azure lab resources
269-
270-
In this task, you will use Azure Cloud Shell to remove the Azure resources provisioned in this lab to eliminate unnecessary charges.
271-
272-
1. In the Azure portal, open the created Resource Group and click on **Delete resource group**.
204+
> [!IMPORTANT]
205+
> Remember to delete the resources created in the Azure portal to avoid unnecessary charges.
273206
274207
## Review
275208

276209
In this lab, you integrated Azure Key Vault with an Azure DevOps pipeline by using the following steps:
277210

278-
- Created an Azure service principal to provide access to an Azure Key Vault secret and authenticate deployment to Azure from Azure DevOps.
279-
- Ran two YAML pipelines imported from a Git repository.
280-
- Configured one pipeline to retrieve the password from Azure Key Vault using a Variable Group and use it on subsequent tasks.
211+
- Created an Azure Key Vault to store an ACR password as a secret.
212+
- Provided access to secrets in the Azure Key Vault.
213+
- Configured permissions to read the secret.
214+
- Configured a pipeline to retrieve the password from the Azure Key Vault and pass it on to subsequent tasks.
215+
- Deployed a container image to Azure Container Instance (ACI) using the secret.
216+
- Created a Variable Group connected to Azure Key Vault.

0 commit comments

Comments
 (0)