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
title: Create and configure a dev center for Azure Deployment Environments by using the Azure CLI
3
3
titleSuffix: Azure Deployment Environments
4
-
description: Learn how to create and access an environment in an Azure Deployment Environments project using Azure CLI.
4
+
description: Learn how to create and access a dev center for Azure Deployment Environments project using the Azure CLI.
5
5
author: renato-marciano
6
6
ms.author: remarcia
7
7
ms.service: deployment-environments
8
8
ms.custom: devx-track-azurecli, build-2023
9
9
ms.topic: quickstart
10
-
ms.date: 04/28/2023
10
+
ms.date: 11/29/2023
11
11
---
12
12
13
13
# Create and configure a dev center for Azure Deployment Environments by using the Azure CLI
14
14
15
-
This quickstart shows you how to create and configure a dev center in Azure Deployment Environments.
16
-
17
-
A platform engineering team typically sets up a dev center, attaches external catalogs to the dev center, creates projects, and provides access to development teams. Development teams create [environments](concept-environments-key-concepts.md#environments) by using [environment definitions](concept-environments-key-concepts.md#environment-definitions), connect to individual resources, and deploy applications.
15
+
This quickstart guide shows you how to create and configure a dev center in Azure Deployment Environments.
18
16
17
+
A platform engineering team typically sets up a dev center, attaches external catalogs to the dev center, creates projects, and provides access to development teams. Development teams can then create [environments](concept-environments-key-concepts.md#environments) by using [environment definitions](concept-environments-key-concepts.md#environment-definitions), connect to individual resources, and deploy applications.
19
18
20
19
## Prerequisites
21
20
22
21
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
23
22
- Azure role-based access control role with permissions to create and manage resources in the subscription, such as [Contributor](../role-based-access-control/built-in-roles.md#contributor) or [Owner](../role-based-access-control/built-in-roles.md#owner).
24
-
-[Install the Azure CLI](/cli/azure/install-azure-cli).
25
-
-[Install dev center CLI extension](how-to-install-devcenter-cli-extension.md)
26
-
- A GitHub Account and a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with Repo Access.
23
+
- Install the [Azure CLI devcenter extension](how-to-install-devcenter-cli-extension.md).
24
+
- A GitHub account and a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with repo access.
27
25
28
26
## Create a dev center
29
-
To create and configure a Dev center in Azure Deployment Environments by using the Azure portal:
27
+
28
+
To create and configure a dev center in Azure Deployment Environments:
30
29
31
30
1. Sign in to the Azure CLI:
32
31
33
32
```azurecli
34
33
az login
35
34
```
36
35
37
-
1. Install the Azure Dev Center extension for the CLI.
36
+
1. Install the Azure CLI *devcenter* extension.
38
37
39
38
```azurecli
40
39
az extension add --name devcenter --upgrade
@@ -43,10 +42,10 @@ To create and configure a Dev center in Azure Deployment Environments by using t
43
42
1. Configure the default subscription as the subscription in which you want to create the dev center:
44
43
45
44
```azurecli
46
-
az account set --subscription <name>
45
+
az account set --subscription <subscriptionName>
47
46
```
48
47
49
-
1. Configure the default location as the location in which you want to create the dev center. Make sure to choose an [available regions for Azure Deployment Environments](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/?products=deployment-environments®ions=all):
48
+
1. Configure the default location where you want to create the dev center. Make sure to choose an [available region for Azure Deployment Environments](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/?products=deployment-environments®ions=all):
50
49
51
50
```azurecli
52
51
az configure --defaults location=eastus
@@ -55,31 +54,31 @@ To create and configure a Dev center in Azure Deployment Environments by using t
55
54
1. Create the resource group in which you want to create the dev center:
56
55
57
56
```azurecli
58
-
az group create -n <group name>
57
+
az group create -n <resourceGroupName>
59
58
```
60
59
61
60
1. Configure the default resource group as the resource group you created:
62
61
63
62
```azurecli
64
-
az config set defaults.group=<group name>
63
+
az config set defaults.group=<resourceGroupName>
65
64
```
66
65
67
66
1. Create the dev center:
68
67
69
68
```azurecli
70
-
az devcenter admin devcenter create -n <devcenter name>
69
+
az devcenter admin devcenter create -n <devcenterName>
71
70
```
72
71
73
-
After a few minutes, you'll get an output that it's created:
72
+
After a few minutes, the output indicates that it was created:
74
73
75
74
```output
76
75
{
77
76
"devCenterUri": "https://...",
78
-
"id": "/subscriptions/.../<devcenter name>",
77
+
"id": "/subscriptions/.../<devcenterName>",
79
78
"location": "eastus",
80
79
"name": "<devcenter name>",
81
80
"provisioningState": "Succeeded",
82
-
"resourceGroup": "<group name>",
81
+
"resourceGroup": "<resourceGroupName>",
83
82
"systemData": {
84
83
"createdAt": "...",
85
84
"createdBy": "...",
@@ -92,24 +91,25 @@ To create and configure a Dev center in Azure Deployment Environments by using t
92
91
> [!NOTE]
93
92
> You can use `--help` to view more details about any command, accepted arguments, and examples. For example, use `az devcenter admin devcenter create --help` to view more details about creating a dev center.
94
93
95
-
## Adding personal access token to Key Vault
96
-
You need an Azure Key Vault to store the GitHub personal access token (PAT) that is used to grant Azure access to your GitHub repository.
94
+
## Add a personal access token to Azure Key Vault
95
+
96
+
You need an Azure Key Vault to store the GitHub personal access token (PAT) that's used to grant Azure access to your GitHub repository.
97
97
98
-
1. Create a Key Vault:
98
+
1. Create a key vault:
99
99
100
100
```azurecli
101
101
# Change the name to something Globally unique
102
-
az keyvault create -n <kv name>
102
+
az keyvault create -n <keyvaultName>
103
103
```
104
104
105
105
> [!NOTE]
106
-
> You may get the following Error:
106
+
> You might get the following error:
107
107
`Code: VaultAlreadyExists Message: The vault name 'kv-devcenter-unique' is already in use. Vault names are globally unique so it is possible that the name is already taken.` You must use a globally unique key vault name.
108
108
109
-
1. Add GitHub personal access token (PAT) to Key Vault as a secret:
109
+
1. Add the GitHub PAT to Key Vault as a secret:
110
110
111
111
```azurecli
112
-
az keyvault secret set --vault-name <kv name> --name GHPAT --value <PAT>
112
+
az keyvault secret set --vault-name <keyvaultName> --name GHPAT --value <personalAccessToken>
113
113
```
114
114
115
115
## Attach an identity to the dev center
@@ -118,91 +118,96 @@ After you create a dev center, attach an [identity](concept-environments-key-con
118
118
119
119
In this quickstart, you configure a system-assigned managed identity for your dev center.
120
120
121
-
## Attach a system-assigned managed identity
121
+
###Attach a system-assigned managed identity
122
122
123
123
To attach a system-assigned managed identity to your dev center:
124
124
125
125
```azurecli
126
-
az devcenter admin devcenter update -n <devcenter name> --identity-type SystemAssigned
126
+
az devcenter admin devcenter update -n <devcenterName> --identity-type SystemAssigned
127
127
```
128
128
129
-
### Assign the system-assigned managed identity access to the key vault secret
130
-
Make sure that the identity has access to the key vault secret that contains the personal access token to access your repository. Key Vaults support two methods of access; Azure role-based access control or Vault access policy. In this quickstart, you use a vault access policy.
129
+
### Give the system-assigned managed identity access to the key vault secret
131
130
132
-
1. Retrieve Object ID of your dev center's identity:
131
+
Make sure that the identity has access to the key vault secret that contains the GitHub PAT to access your repository. Key Vaults support two methods of access; Azure role-based access control or vault access policy. In this quickstart, you use a vault access policy.
132
+
133
+
1. Retrieve the Object ID of your dev center's identity:
133
134
134
135
```azurecli
135
-
OID=$(az ad sp list --display-name <devcenter name> --query [].id -o tsv)
136
+
OID=$(az ad sp list --display-name <devcenterName> --query [].id -o tsv)
136
137
echo $OID
137
138
```
138
139
139
-
1. Add a Key Vault Policy to allow dev center to get secrets from Key Vault:
140
+
1. Add a Key Vault policy to allow the dev center to get secrets from Key Vault:
140
141
141
142
```azurecli
142
-
az keyvault set-policy -n <kv name> --secret-permissions get --object-id $OID
143
+
az keyvault set-policy -n <keyvaultName> --secret-permissions get --object-id $OID
143
144
```
144
145
145
146
## Add a catalog to the dev center
146
-
Azure Deployment Environments supports attaching Azure DevOps repositories and GitHub repositories. You can store a set of curated IaC templates in a repository. Attaching the repository to a dev center as a catalog gives your development teams access to the templates and enables them to quickly create consistent environments.
147
+
148
+
Azure Deployment Environments supports attaching Azure DevOps repositories and GitHub repositories. You can store a set of curated IaC templates in a repository. Attaching the repository to a dev center as a catalog gives your development teams access to the templates and allows them to quickly create consistent environments.
147
149
148
150
In this quickstart, you attach a GitHub repository that contains samples created and maintained by the Azure Deployment Environments team.
149
151
150
152
To add a catalog to your dev center, you first need to gather some information.
151
153
152
154
### Gather GitHub repo information
155
+
153
156
To add a catalog, you must specify the GitHub repo URL, the branch, and the folder that contains your environment definitions. You can gather this information before you begin the process of adding the catalog to the dev center.
154
157
158
+
You can use this [sample catalog](https://github.com/Azure/deployment-environments) as your repository. Make a fork of the repository for the following steps.
159
+
155
160
> [!TIP]
156
-
> If you are attaching an Azure DevOps repository, use these steps: [Get the clone URL of an Azure DevOps repository](how-to-configure-catalog.md#get-the-clone-url-for-your-azure-devops-repository).
161
+
> If you're attaching an Azure DevOps repository, use these steps: [Get the clone URL of an Azure DevOps repository](how-to-configure-catalog.md#get-the-clone-url-for-your-azure-devops-repository).
157
162
158
-
1.On your [GitHub](https://github.com) account page, select **<> Code**, and then select copy.
159
-
1.Take a note of the branch that you're working in.
163
+
1.Navigate to your repository, select **<> Code**, and then copy the clone URL.
164
+
1.Make a note of the branch that you're working in.
160
165
1. Take a note of the folder that contains your environment definitions.
161
-
162
-
:::image type="content" source="media/how-to-create-configure-dev-center/github-info.png" alt-text="Screenshot that shows the GitHub repo with Code, branch, and folder highlighted.":::
166
+
167
+
:::image type="content" source="media/how-to-create-configure-dev-center/github-info.png" alt-text="Screenshot that shows the GitHub repo with branch, copy URL, and folder highlighted." lightbox="media/how-to-create-configure-dev-center/github-info.png":::
163
168
164
169
### Add a catalog to your dev center
165
170
166
171
1. Retrieve the secret identifier:
167
-
172
+
168
173
```azurecli
169
-
SECRETID=$(az keyvault secret show --vault-name <kv name> --name GHPAT --query id -o tsv)
174
+
SECRETID=$(az keyvault secret show --vault-name <keyvaultName> --name GHPAT --query id -o tsv)
1. Confirm that the catalog is successfully added and synced:
186
+
1. Confirm that the catalog was successfully added and synced:
182
187
183
188
```azurecli
184
-
az devcenter admin catalog list -d <devcenter name> -o table
189
+
az devcenter admin catalog list -d <devcenterName> -o table
185
190
```
186
191
187
192
## Create an environment type
188
193
189
194
Use an environment type to help you define the different types of environments your development teams can deploy. You can apply different settings for each environment type.
190
195
191
-
1. Create an Environment Type:
196
+
1. Create an environment type:
192
197
193
198
```azurecli
194
-
az devcenter admin environment-type create -d <devcenter name> -n <environment type name>
199
+
az devcenter admin environment-type create -d <devcenterName> -n <environmentTypeName>
195
200
```
196
201
197
-
1. Confirm that the Environment type is created:
202
+
1. Confirm that the environment type was created:
198
203
199
204
```azurecli
200
-
az devcenter admin environment-type list -d <devcenter name> -o table
205
+
az devcenter admin environment-type list -d <devcenterName> -o table
201
206
```
202
207
203
208
## Next steps
204
209
205
210
In this quickstart, you created a dev center and configured it with an identity, a catalog, and an environment type. To learn how to create and configure a project, advance to the next quickstart.
206
211
207
212
> [!div class="nextstepaction"]
208
-
> [Create and configure a project with Azure CLI](how-to-create-configure-projects.md)
213
+
> [Create and configure a project by using the Azure CLI](how-to-create-configure-projects.md)
0 commit comments