You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/deployment-environments/tutorial-deploy-environments-in-cicd-azure-devops.md
+62-65Lines changed: 62 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,21 +12,20 @@ ms.date: 07/25/2025
12
12
13
13
# Tutorial: Deploy environments in CI/CD by using Azure Pipelines
14
14
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.
16
16
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.
18
18
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).
20
20
21
21
In this tutorial, you learn how to:
22
22
23
23
> [!div class="checklist"]
24
24
> * 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
27
27
> * Create a pipeline
28
28
> * Create an environment
29
-
> * Test the CI/CD pipeline
30
29
31
30
## Prerequisites
32
31
@@ -36,150 +35,148 @@ In this tutorial, you learn how to:
36
35
- An Azure DevOps subscription.
37
36
-[Create an account for free](https://azure.microsoft.com/services/devops/?WT.mc_id=A261C142F).
38
37
- An Azure DevOps organization and project.
39
-
- Azure Deployment Environments.
38
+
-In Azure Deployment Environments:
40
39
-[Dev center and project](./quickstart-create-and-configure-devcenter.md).
41
40
-[Sample catalog](https://github.com/Azure/deployment-environments) attached to the dev center.
42
41
43
42
## Create and configure an Azure Repos repository
44
43
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. Select your project.
46
45
1. Select **Repos** > **Files**.
47
46
1. In **Import a repository**, select **Import**.
48
47
1. In **Import a Git repository**, select or enter the following:
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.
53
+
Environment types define the types of environments that your development teams can deploy. You can apply different settings for each environment type. You create environment types at the dev center level and at the project level.
56
54
57
-
Create dev center environment types:
55
+
To create dev center environment types:
58
56
59
57
1. Sign in to the [Azure portal](https://portal.azure.com).
60
58
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**.
59
+
1. In the left menu, under **Environment configuration**, select **Environment types**, and then select **Create**.
60
+
1. Use the following steps to create three environment types: Sandbox, FunctionApp, and WebApp.
61
+
62
+
1. In **Create environment type**, enter the following information, and then select **Add**.
64
63
65
-
|Name |Value |
66
-
|---------|----------|
67
-
|**Name**|Enter a name for the environment type.|
68
-
|**Tags**|Enter a tag name and a tag value.|
64
+
|Name |Value |
65
+
|---------|----------|
66
+
|**Name**|Enter a name for the environment type.|
67
+
|**Tags**|Enter a tag name and a tag value.|
69
68
70
-
1. Confirm that the environment type was added by checking your Azure portal notifications.
69
+
1. Confirm that the environment type was added by checking your Azure portal notifications.
71
70
72
-
Create project environment types:
71
+
To create project environment types:
73
72
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:
73
+
1. In the left menu, under **Manage**, select **Projects**, and then select the project that you want to use.
74
+
1. In the left menu, under **Environment configuration**, select **Environment types**, and then select **Add**.
75
+
1. Use the following steps to add the three environment types: Sandbox, FunctionApp, and WebApp.
76
+
1.In **Add environment type to \<project-name\>**, enter or select the following information:
78
77
79
-
|Name |Value |
80
-
|---------|----------|
81
-
|**Type**| Select a dev centerlevel 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.|
78
+
|Name |Value |
79
+
|---------|----------|
80
+
|**Type**| Select a dev center-level environment type to enable for the specific project.|
81
+
|**Deployment subscription**| Select the subscription in which the environment is created.|
82
+
|**Deployment identity**| Select either a system-assigned or a user-assigned managed identity to perform deployments on behalf of the user.|
83
+
|**Permissions on environment resources** > **Environment creator role(s)**| Select the roles to give access to the environment resources.|
84
+
|**Permissions on environment resources** > **Additional access**| Select the users or Microsoft Entra groups to assign to specific roles on the environment resources.|
85
+
|**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
86
88
-
1. Confirm that the environment type was added by checking your Azure portal notifications.
87
+
1. Confirm that the environment type was added by checking your Azure portal notifications.
89
88
90
89
91
90
## Configure a service connection
92
91
93
92
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.
94
93
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.
94
+
1. Sign in to your Azure DevOps organization (`https://dev.azure.com/<your-organization>`). Replace `<your-organization>` with your project identifier. Select your project.
96
95
1. Select **Project settings** > **Service connections** > **+ New service connection**.
97
96
1. In the **New service connection** pane, select the **Azure Resource Manager**, and then select **Next**.
98
97
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.
98
+
1. Enter the following service connection details, and then select **Save** to create the service connection.
100
99
101
100
| Field | Value |
102
101
| ----- | ----- |
103
102
|**Scope level**|*Subscription*. |
104
103
|**Subscription**| Select the Azure subscription that hosts your dev center resource. |
105
104
|**Resource group**| Select the resource group that contains your dev center resource. |
106
105
|**Service connection name**| Enter a unique name for the service connection. |
107
-
|**Grant access permission to all pipelines**|Checked. |
106
+
|**Grant access permission to all pipelines**|Select the checkbox. |
108
107
109
108
1. From the list of service connections, select the one you created earlier, and then select **Manage Service Principal**.
110
109
The Azure portal opens in a separate browser tab and shows the service principal details.
111
110
1. In the Azure portal, copy the **Display name** value.
112
111
You use this value in the next step to grant permissions for running load tests to the service principal.
113
112
114
-
### Grant the service connection access to the ADE project
113
+
### Grant the service connection access to the Deployment Environments project
115
114
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.
115
+
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 service principal.
117
116
118
-
1. In the [Azure portal](https://portal.azure.com/), go to your ADE project.
117
+
1. In the [Azure portal](https://portal.azure.com/), go to your Deployment Environments project.
119
118
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.
119
+
1.On the **Role** tab, select **Deployment Environments User** in the list of job function roles.
120
+
1.On the **Members** tab, select **Select members**, and then use the display name you copied previously to search for the service principal.
122
121
1. Select the service principal, and then select **Select**.
123
-
1.In the **Review + assign tab**, select **Review + assign** to add the role assignment.
122
+
1.On the **Review + assign** tab, select **Review + assign** to add the role assignment.
124
123
125
-
You can now use the service connection in your Azure Pipelines workflow definition to access your ADE environments.
124
+
You can now use the service connection in your Azure Pipelines workflow definition to access your Deployment Environments environments.
126
125
127
-
### Grant your account access to the ADE project
126
+
### Grant your account access to the Deployment Environments project
128
127
129
-
To view environments created by other users, including the service connection, you need to grant your account read access to the ADE project.
128
+
To view environments created by other users, including the service connection, you need to grant your account read access to the Deployment Environments project.
130
129
131
-
1. In the [Azure portal](https://portal.azure.com/), go to your ADE project.
130
+
1. In the [Azure portal](https://portal.azure.com/), go to your Deployment Environments project.
132
131
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.
132
+
1.On the **Role** tab, select **Deployment Environments Reader** in the list of job function roles.
133
+
1.On the **Members** tab, select **Select members**, and then search for your own account.
135
134
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.
135
+
1.On the **Review + assign** tab, select **Review + assign** to add the role assignment.
137
136
138
137
You can now view the environments created by your Azure Pipelines workflow.
139
138
140
139
## Configure a pipeline
141
140
142
-
Edit the `azure-pipelines.yml` file in your Azure Repos repository to customize your pipeline.
141
+
Edit the *azure-pipelines.yml* file in your Azure Repos repository to customize your pipeline.
143
142
144
143
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.
145
144
146
145
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.
146
+
- Specify the service connection to use.
147
+
- Use an inline script to run an Azure CLI command that creates the environment.
149
148
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).
149
+
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).
151
150
152
151
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:
152
+
1. In the **Files** pane, in the **.ado** folder, select the **azure-pipelines.yml** file.
153
+
1. In the azure-pipelines.yml file, edit the existing content:
155
154
- 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:
155
+
- In the `Inline script`, replace each of the following placeholders with values that are appropriate to your Azure environment:
157
156
158
157
| Placeholder | Value |
159
158
| ------------------------------- | ----- |
160
159
|`<dev-center-name>`| The name of your dev center. |
161
160
|`<project-name>`| The name of your project. |
162
161
|`<catalog-name>`| The name of your catalog. |
163
-
|`<environment-definition-name>`| Do not change. Defines the environment definition that is used. |
162
+
|`<environment-definition-name>`| Do not change. Defines the environment definition that's used. |
164
163
|`<environment-type>`| The environment type. |
165
164
|`<environment-name>`| Specify a name for your new environment. |
166
-
|`<parameters>`| Do not change. References the json file that defines parameters for the environment. |
165
+
|`<parameters>`| Do not change. References the JSON file that defines parameters for the environment. |
167
166
168
167
1. Select **Commit** to save your changes.
169
168
1. In the **Commit changes** pane, enter a commit message, and then select **Commit**.
170
169
170
+
## Create an environment by using a pipeline
171
171
172
-
## Create an environment using a pipeline
173
-
174
-
Next, you run the pipeline to create the ADE environment.
172
+
Next, you run the pipeline to create the Deployment Environments environment.
175
173
176
174
1. In your Azure DevOps project, select **Pipelines**.
177
175
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
-
176
+
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.
177
+
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**.
181
178
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.
179
+
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.
0 commit comments