Skip to content

Commit 85d8e51

Browse files
Merge pull request #303212 from v-albemi/deploy-with-pipeline
Freshness Edit: Azure Deployment Environments
2 parents 75108c5 + 08a213e commit 85d8e51

File tree

1 file changed

+88
-86
lines changed

1 file changed

+88
-86
lines changed

articles/deployment-environments/tutorial-deploy-environments-in-cicd-azure-devops.md

Lines changed: 88 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
---
2-
title: 'Tutorial: Deploy environments with Azure Pipelines'
3-
description: Learn how to integrate Azure Deployment Environments into your Azure Pipelines CI/CD pipeline and streamline your software development process.
2+
title: 'Tutorial: Deploy Environments with Azure Pipelines'
3+
description: Learn how to integrate Azure Deployment Environments into your Azure Pipelines CI/CD pipeline to streamline your software development process.
44
author: RoseHJM
55
ms.author: rosemalcolm
66
ms.service: azure-deployment-environments
77
ms.topic: tutorial
8-
ms.date: 02/26/2024
8+
ms.date: 07/25/2025
99

10-
# customer intent: As a developer, I want to use an Azure Pipeline to deploy an ADE deployment environment so that I can integrate it into a CI/CD development environment.
10+
# customer intent: As a developer, I want to use Azure Pipelines to deploy an Azure Deployment Environments deployment environment so that I can integrate it into a CI/CD development environment.
1111
---
1212

1313
# Tutorial: Deploy environments in CI/CD by using Azure Pipelines
1414

15-
In this tutorial, you learn how to integrate Azure Deployment Environments (ADE) into your Azure Pipelines CI/CD pipeline.
15+
In this tutorial, you learn how to integrate Azure Deployment Environments into your Azure Pipelines CI/CD pipeline.
1616

17-
Continuous integration and continuous delivery (CI/CD) is a software development approach that helps teams to automate the process of building, testing, and deploying software changes. CI/CD enables you to release software changes more frequently and with greater confidence.
17+
Continuous integration and continuous delivery (CI/CD) is a software development approach that helps teams automate the process of building, testing, and deploying software changes. CI/CD enables you to release software changes more frequently and with greater confidence.
1818

19-
Before beginning this tutorial, familiarize yourself with Deployment Environments resources and concepts by reviewing [Key concepts for Azure Deployment Environments](concept-environments-key-concepts.md).
19+
Before starting this tutorial, familiarize yourself with Deployment Environments resources and concepts by reviewing [Key concepts for Azure Deployment Environments](concept-environments-key-concepts.md).
2020

2121
In this tutorial, you learn how to:
2222

2323
> [!div class="checklist"]
2424
> * Create and configure an Azure Repos repository
25-
> * Connect the catalog to your dev center
26-
> * Configure service connection
25+
> * Configure environment types
26+
> * Configure a service connection
2727
> * Create a pipeline
2828
> * Create an environment
29-
> * Test the CI/CD pipeline
3029
3130
## Prerequisites
3231

@@ -36,150 +35,153 @@ In this tutorial, you learn how to:
3635
- An Azure DevOps subscription.
3736
- [Create an account for free](https://azure.microsoft.com/services/devops/?WT.mc_id=A261C142F).
3837
- An Azure DevOps organization and project.
39-
- Azure Deployment Environments.
40-
- [Dev center and project](./quickstart-create-and-configure-devcenter.md).
38+
- In Azure Deployment Environments:
39+
- [A dev center and a project](./quickstart-create-and-configure-devcenter.md).
4140
- [Sample catalog](https://github.com/Azure/deployment-environments) attached to the dev center.
4241

4342
## Create and configure an Azure Repos repository
4443

45-
1. Sign in to your Azure DevOps organization (`https://dev.azure.com/<your-organization>`), and select your project. Replace the `<your-organization>` text placeholder with your project identifier.
44+
1. Sign in to your Azure DevOps organization (`https://dev.azure.com/<your-organization>`). Replace `<your-organization>` with your project identifier.
45+
1. Select your project.
4646
1. Select **Repos** > **Files**.
4747
1. In **Import a repository**, select **Import**.
4848
1. In **Import a Git repository**, select or enter the following:
4949
- **Repository type**: Git
5050
- **Clone URL**: https://github.com/Azure/deployment-environments
5151

52-
5352
## Configure environment types
5453

55-
Environment types define the different types of environments your development teams can deploy. You can apply different settings for each environment type. You create environment types at the dev center level and referenced at the project level.
54+
Environment types define the types of environments that your development teams can deploy. You can apply different settings for each environment type. You can create environment types at the dev center level and at the project level.
5655

57-
Create dev center environment types:
56+
To create dev center environment types:
5857

5958
1. Sign in to the [Azure portal](https://portal.azure.com).
6059
1. In **Dev centers**, select your dev center.
61-
1. In the left menu under **Environment configuration**, select **Environment types**, and then select **Create**.
62-
1. Use the following steps to create three environment types: Sandbox, FunctionApp, WebApp.
63-
In **Create environment type**, enter the following information, and then select **Add**.
60+
1. In the left menu, under **Environment configuration**, select **Environment types**, and then select **Create**.
61+
1. Use the following steps to create three environment types: Sandbox, FunctionApp, and WebApp.
62+
63+
1. In **Create environment type**, enter the following information, and then select **Add**.
6464

65-
|Name |Value |
66-
|---------|----------|
67-
|**Name**|Enter a name for the environment type.|
68-
|**Tags**|Enter a tag name and a tag value.|
65+
|Name |Value |
66+
|---------|----------|
67+
|**Name**|Enter a name for the environment type.|
68+
|**Tags**|Enter a tag name and a tag value.|
6969

70-
1. Confirm that the environment type was added by checking your Azure portal notifications.
70+
1. Confirm that the environment type appears in the list.
7171

72-
Create project environment types:
72+
To create project environment types:
7373

74-
1. In the left menu under **Manage**, select **Projects**, and then select the project you want to use.
75-
1. In the left menu under **Environment configuration**, select **Environment types**, and then select **Add**.
76-
1. Use the following steps to add the three environment types: Sandbox, FunctionApp, WebApp.
77-
In **Add environment type to \<project-name\>**, enter or select the following information:
74+
1. In the left menu, under **Manage**, select **Projects**, and then select the project that you want to use.
75+
1. In the left menu, under **Environment configuration**, select **Environment types**, and then select **Add**.
76+
1. Use the following steps to add the three environment types: Sandbox, FunctionApp, and WebApp.
77+
1. In **Add environment type to \<project-name\>**, enter or select the following information:
7878

79-
|Name |Value |
80-
|---------|----------|
81-
|**Type**| Select a dev center level environment type to enable for the specific project.|
82-
|**Deployment subscription**| Select the subscription in which the environment is created.|
83-
|**Deployment identity** | Select either a system-assigned identity or a user-assigned managed identity to perform deployments on behalf of the user.|
84-
|**Permissions on environment resources** > **Environment creator role(s)**| Select the roles to give access to the environment resources.|
85-
|**Permissions on environment resources** > **Additional access** | Select the users or Microsoft Entra groups to assign to specific roles on the environment resources.|
86-
|**Tags** | Enter a tag name and a tag value. These tags are applied on all resources that are created as part of the environment.|
87-
88-
1. Confirm that the environment type was added by checking your Azure portal notifications.
79+
|Name |Value |
80+
|---------|----------|
81+
|**Type**| Select a dev center-level environment type to enable for the specific project.|
82+
|**Deployment subscription**| Select the subscription in which the environment is created.|
83+
|**Deployment identity** | Select either a system-assigned or a user-assigned managed identity to perform deployments on behalf of the user.|
84+
|**Permissions on environment resources** > **Environment creator role(s)**| Select the roles to give access to the environment resources.|
85+
|**Permissions on environment resources** > **Additional access** | Select the users or Microsoft Entra groups to assign to specific roles on the environment resources.|
86+
|**Tags** | Enter a tag name and a tag value. These tags are applied on all resources that are created as part of the environment.|
8987

88+
1. Confirm that the environment type appears in the list.
9089

9190
## Configure a service connection
9291

93-
In Azure Pipelines, you create a *service connection* in your Azure DevOps project to access resources in your Azure subscription. When you create the service connection, Azure DevOps creates a Microsoft Entra service principal object.
92+
In Azure Pipelines, you create a *service connection* in your Azure DevOps project to access resources in your Azure subscription.
9493

95-
1. Sign in to your Azure DevOps organization (`https://dev.azure.com/<your-organization>`), and select your project. Replace the `<your-organization>` text placeholder with your project identifier.
96-
1. Select **Project settings** > **Service connections** > **+ New service connection**.
97-
1. In the **New service connection** pane, select the **Azure Resource Manager**, and then select **Next**.
98-
1. Select the **Service Principal (automatic)** authentication method, and then select **Next**.
99-
1. Enter the service connection details, and then select **Save** to create the service connection.
94+
1. If you don't have a user-assigned managed identity for the project, [add one](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp#create-a-user-assigned-managed-identity).
95+
> [!NOTE]
96+
> You can use one of three options for identity: app registration, user-assigned managed identity, and system-assigned managed identity. App registration is the most secure option. To use app registration, you need to have appropriate permissions. For more information see [Azure Resource Manager service connection special cases](/azure/devops/pipelines/library/azure-resource-manager-alternate-approaches).
97+
1. Sign in to your Azure DevOps organization (`https://dev.azure.com/<your-organization>`). Replace `<your-organization>` with your project identifier.
98+
1. Select your project.
99+
1. Select **Project settings** > **Service connections** > **Create service connection**.
100+
1. In the **New service connection** pane, select **Azure Resource Manager**, and then select **Next**.
101+
1. Enter the following service connection details, and then select **Save** to create the service connection.
100102

101103
| Field | Value |
102104
| ----- | ----- |
103-
| **Scope level** | *Subscription*. |
104-
| **Subscription** | Select the Azure subscription that hosts your dev center resource. |
105-
| **Resource group** | Select the resource group that contains your dev center resource. |
106-
| **Service connection name** | Enter a unique name for the service connection. |
107-
| **Grant access permission to all pipelines** | Checked. |
105+
|**Identity type**|**Managed identity**|
106+
|**Subscription for managed identity**|Enter the Azure subscription that contains the managed identity. |
107+
|**Resource group for managed identity** |Enter the resource group that contains the managed identity.|
108+
|**Managed identity** |Enter the name of the managed identity.|
109+
| **Scope level for service connection** | **Subscription** |
110+
| **Subscription for service connection** | Enter the ID of the Azure subscription that hosts your dev center resource. |
111+
| **Service Connection Name** | Enter a unique name for the service connection. |
112+
| **Grant access permission to all pipelines** | Select this checkbox. |
108113

109-
1. From the list of service connections, select the one you created earlier, and then select **Manage Service Principal**.
110-
The Azure portal opens in a separate browser tab and shows the service principal details.
111-
1. In the Azure portal, copy the **Display name** value.
112-
You use this value in the next step to grant permissions for running load tests to the service principal.
114+
1. Select **Save**.
113115

114-
### Grant the service connection access to the ADE project
116+
### Grant the service connection access to the Deployment Environments project
115117

116-
Azure Deployment Environments uses role-based access control to grant permissions for performing specific activities on your ADE resource. To make changes from a CI/CD pipeline, you grant the Deployment Environments User role to the service principal.
118+
Deployment Environments uses role-based access control to grant permissions for performing specific activities on your Deployment Environments resource. To make changes from a CI/CD pipeline, you grant the Deployment Environments User role to the managed identity.
117119

118-
1. In the [Azure portal](https://portal.azure.com/), go to your ADE project.
120+
121+
122+
1. In the [Azure portal](https://portal.azure.com/), go to your Deployment Environments project.
119123
1. Select **Access control (IAM)** > **Add** > **Add role assignment**.
120-
1. In the **Role** tab, select **Deployment Environments User** in the list of job function roles.
121-
1. In the **Members** tab, select **Select members**, and then use the display name you copied previously to search the service principal.
122-
1. Select the service principal, and then select **Select**.
123-
1. In the **Review + assign tab**, select **Review + assign** to add the role assignment.
124+
1. On the **Role** tab, select **Deployment Environments User** in the list of job function roles.
125+
1. On the **Members** tab, select **Managed identity** and **Select members**.
126+
1. In the **Select managed identities** tab, under **Managed identity**, select the **Project** identity, select the project name, and then select **Select**.
127+
1. On the **Review + assign** tab, select **Review + assign** to add the role assignment.
124128

125-
You can now use the service connection in your Azure Pipelines workflow definition to access your ADE environments.
129+
You can now use the service connection in your Azure Pipelines workflow definition to access your Deployment Environments environments.
126130

127-
### Grant your account access to the ADE project
131+
### Grant your account access to the Deployment Environments project
128132

129-
To view environments created by other users, including the service connection, you need to grant your account read access to the ADE project.
133+
To view environments created by other users, including the service connection, you need to grant your account read access to the Deployment Environments project.
130134

131-
1. In the [Azure portal](https://portal.azure.com/), go to your ADE project.
135+
1. In the [Azure portal](https://portal.azure.com/), go to your Deployment Environments project.
132136
1. Select **Access control (IAM)** > **Add** > **Add role assignment**.
133-
1. In the **Role** tab, select **Deployment Environments Reader** in the list of job function roles.
134-
1. In the **Members** tab, select **Select members**, and then search for your own account.
137+
1. On the **Role** tab, select **Deployment Environments Reader** in the list of job function roles.
138+
1. On the **Members** tab, select **Select members**, and then search for your own account.
135139
1. Select your account from the list, and then select **Select**.
136-
1. In the **Review + assign tab**, select **Review + assign** to add the role assignment.
140+
1. On the **Review + assign** tab, select **Review + assign** to add the role assignment.
137141

138142
You can now view the environments created by your Azure Pipelines workflow.
139143

140144
## Configure a pipeline
141145

142-
Edit the `azure-pipelines.yml` file in your Azure Repos repository to customize your pipeline.
146+
Edit the *azure-pipelines.yml* file in your Azure Repos repository to customize your pipeline.
143147

144148
In the pipeline, you define the steps to create the environment. In this pipeline, you define the steps to create the environment as a job, which is a series of steps that run sequentially as a unit.
145149

146-
To customize the pipeline you:
147-
- Specify the Service Connection to use, and The pipeline uses the Azure CLI to create the environment.
148-
- Use an Inline script to run an Azure CLI command that creates the environment.
150+
To customize the pipeline, you:
151+
- Specify the service connection to use.
152+
- Use an inline script to run an Azure CLI command that creates the environment.
149153

150-
The Azure CLI is a command-line tool that provides a set of commands for working with Azure resources. To discover more Azure CLI commands, see [az devcenter](/cli/azure/devcenter?view=azure-cli-latest&preserve-view=true).
154+
Azure CLI is a command-line tool that provides a set of commands for working with Azure resources. To learn about more Azure CLI commands, see [az devcenter](/cli/azure/devcenter?view=azure-cli-latest&preserve-view=true).
151155

152156
1. In your Azure DevOps project, select **Repos** > **Files**.
153-
1. In the **Files** pane, from the `.ado` folder, select `azure-pipelines.yml` file.
154-
1. In the `azure-pipelines.yml` file, edit the existing content with the following code:
157+
1. In the **Files** pane, in the **.ado** folder, select the **azure-pipelines.yml** file.
158+
1. In the azure-pipelines.yml file, edit the existing content:
155159
- Replace `<AzureServiceConnectionName>` with the name of the service connection you created earlier.
156-
- In the `Inline script`, replace each of the following placeholders with values appropriate to your Azure environment:
160+
- In the `Inline script` input, replace each of the following placeholders with values that are appropriate to your Azure environment:
157161

158162
| Placeholder | Value |
159163
| ------------------------------- | ----- |
160-
| `<dev-center-name>` | The name of your dev center. |
164+
| `<DevCenterName>` | The name of your dev center. |
161165
| `<project-name>` | The name of your project. |
162166
| `<catalog-name>` | The name of your catalog. |
163-
| `<environment-definition-name>` | Do not change. Defines the environment definition that is used. |
167+
| `<environment-definition-name>` | Do not change. Defines the environment definition that's used. |
164168
| `<environment-type>` | The environment type. |
165169
| `<environment-name>` | Specify a name for your new environment. |
166-
| `<parameters>` | Do not change. References the json file that defines parameters for the environment. |
170+
| `<parameters>` | Do not change. References the JSON file that defines parameters for the environment. |
167171

168172
1. Select **Commit** to save your changes.
169173
1. In the **Commit changes** pane, enter a commit message, and then select **Commit**.
170174

175+
## Create an environment by using a pipeline
171176

172-
## Create an environment using a pipeline
173-
174-
Next, you run the pipeline to create the ADE environment.
177+
Next, you run the pipeline to create the Deployment Environments environment.
175178

176179
1. In your Azure DevOps project, select **Pipelines**.
177180
1. Select the pipeline you created earlier, and then select **Run pipeline**.
178-
1. You can check on the progress of the pipeline run by selecting the pipeline name, and then selecting **Runs**. Select the run to see the details of the pipeline run.
179-
1. You can also check the progress of the environment creation in the Azure portal by selecting your dev center, selecting your project, and then selecting **Environments**.
180-
181+
1. You can check on the progress of the pipeline run by selecting the pipeline name and then selecting **Runs**. Select the run to see the details of the pipeline run.
182+
1. You can also check the progress of the creation of the environment in the Azure portal by selecting your dev center, selecting your project, and then selecting **Environments**.
181183

182-
You can insert this job anywhere in a Continuous Integration (CI) and/or a Continuous Delivery (CD) pipeline. Get started with the [Azure Pipelines documentation](/azure/devops/pipelines/?view=azure-devops&preserve-view=true) to learn more about creating and managing pipelines.
184+
You can insert this job anywhere in a CI and/or CD pipeline. See the [Azure Pipelines documentation](/azure/devops/pipelines/?view=azure-devops&preserve-view=true) to learn more about creating and managing pipelines.
183185

184186
## Clean up resources
185187

0 commit comments

Comments
 (0)