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
2
+
title: Create and configure a dev center 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
-
# Create and configure a dev center for Azure Deployment Environments by using the Azure CLI
13
+
# Create and configure a dev center 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
23
-[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.
24
+
-[Install the dev center CLI extension](how-to-install-devcenter-cli-extension.md)
25
+
- 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
26
28
27
## Create a dev center
29
-
To create and configure a Dev center in Azure Deployment Environments by using the Azure portal:
28
+
29
+
To create and configure a dev center in Azure Deployment Environments:
30
30
31
31
1. Sign in to the Azure CLI:
32
32
33
33
```azurecli
34
34
az login
35
35
```
36
36
37
-
1. Install the Azure Dev Center extension for the CLI.
37
+
1. Install the Azure CLI *devcenter* extension.
38
38
39
39
```azurecli
40
40
az extension add --name devcenter --upgrade
@@ -43,10 +43,10 @@ To create and configure a Dev center in Azure Deployment Environments by using t
43
43
1. Configure the default subscription as the subscription in which you want to create the dev center:
44
44
45
45
```azurecli
46
-
az account set --subscription <name>
46
+
az account set --subscription <subscriptionName>
47
47
```
48
48
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):
49
+
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
50
51
51
```azurecli
52
52
az configure --defaults location=eastus
@@ -55,31 +55,31 @@ To create and configure a Dev center in Azure Deployment Environments by using t
55
55
1. Create the resource group in which you want to create the dev center:
56
56
57
57
```azurecli
58
-
az group create -n <group name>
58
+
az group create -n <resourceGroupName>
59
59
```
60
60
61
61
1. Configure the default resource group as the resource group you created:
62
62
63
63
```azurecli
64
-
az config set defaults.group=<group name>
64
+
az config set defaults.group=<resourceGroupName>
65
65
```
66
66
67
67
1. Create the dev center:
68
68
69
69
```azurecli
70
-
az devcenter admin devcenter create -n <devcenter name>
70
+
az devcenter admin devcenter create -n <devcenterName>
71
71
```
72
72
73
-
After a few minutes, you'll get an output that it's created:
73
+
After a few minutes, the output indicates that it was created:
74
74
75
75
```output
76
76
{
77
77
"devCenterUri": "https://...",
78
-
"id": "/subscriptions/.../<devcenter name>",
78
+
"id": "/subscriptions/.../<devcenterName>",
79
79
"location": "eastus",
80
80
"name": "<devcenter name>",
81
81
"provisioningState": "Succeeded",
82
-
"resourceGroup": "<group name>",
82
+
"resourceGroup": "<resourceGroupName>",
83
83
"systemData": {
84
84
"createdAt": "...",
85
85
"createdBy": "...",
@@ -92,24 +92,25 @@ To create and configure a Dev center in Azure Deployment Environments by using t
92
92
> [!NOTE]
93
93
> 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
94
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.
95
+
## Add a personal access token to Azure Key Vault
97
96
98
-
1. Create a Key Vault:
97
+
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.
98
+
99
+
1. Create a key vault:
99
100
100
101
```azurecli
101
102
# Change the name to something Globally unique
102
-
az keyvault create -n <kv name>
103
+
az keyvault create -n <keyvaultName>
103
104
```
104
105
105
106
> [!NOTE]
106
-
> You may get the following Error:
107
+
> You might get the following error:
107
108
`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
109
109
-
1. Add GitHub personal access token (PAT) to Key Vault as a secret:
110
+
1. Add the GitHub PAT to Key Vault as a secret:
110
111
111
112
```azurecli
112
-
az keyvault secret set --vault-name <kv name> --name GHPAT --value <PAT>
113
+
az keyvault secret set --vault-name <kv name> --name GHPAT --value <personalAccessToken>
113
114
```
114
115
115
116
## Attach an identity to the dev center
@@ -118,91 +119,96 @@ After you create a dev center, attach an [identity](concept-environments-key-con
118
119
119
120
In this quickstart, you configure a system-assigned managed identity for your dev center.
120
121
121
-
## Attach a system-assigned managed identity
122
+
###Attach a system-assigned managed identity
122
123
123
124
To attach a system-assigned managed identity to your dev center:
124
125
125
126
```azurecli
126
-
az devcenter admin devcenter update -n <devcenter name> --identity-type SystemAssigned
127
+
az devcenter admin devcenter update -n <devcenterName> --identity-type SystemAssigned
127
128
```
128
129
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.
130
+
### Give the system-assigned managed identity access to the key vault secret
131
+
132
+
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.
131
133
132
-
1. Retrieve Object ID of your dev center's identity:
134
+
1. Retrieve the Object ID of your dev center's identity:
133
135
134
136
```azurecli
135
-
OID=$(az ad sp list --display-name <devcenter name> --query [].id -o tsv)
137
+
OID=$(az ad sp list --display-name <devcenterName> --query [].id -o tsv)
136
138
echo $OID
137
139
```
138
140
139
-
1. Add a Key Vault Policy to allow dev center to get secrets from Key Vault:
141
+
1. Add a Key Vault policy to allow the dev center to get secrets from Key Vault:
140
142
141
143
```azurecli
142
-
az keyvault set-policy -n <kv name> --secret-permissions get --object-id $OID
144
+
az keyvault set-policy -n <keyvaultName> --secret-permissions get --object-id $OID
143
145
```
144
146
145
147
## 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.
148
+
149
+
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
150
148
151
In this quickstart, you attach a GitHub repository that contains samples created and maintained by the Azure Deployment Environments team.
149
152
150
153
To add a catalog to your dev center, you first need to gather some information.
151
154
152
155
### Gather GitHub repo information
156
+
153
157
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
158
159
+
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.
160
+
155
161
> [!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).
162
+
> 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
163
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.
164
+
1.Navigate to your repository, select **<> Code**, and then select copy.
165
+
1.Make a note of the branch that you're working in.
160
166
1. Take a note of the folder that contains your environment definitions.
161
167
162
168
:::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.":::
163
169
164
170
### Add a catalog to your dev center
165
171
166
172
1. Retrieve the secret identifier:
167
-
173
+
168
174
```azurecli
169
-
SECRETID=$(az keyvault secret show --vault-name <kv name> --name GHPAT --query id -o tsv)
175
+
SECRETID=$(az keyvault secret show --vault-name <keyvaultName> --name GHPAT --query id -o tsv)
170
176
echo $SECRETID
171
177
```
172
178
173
-
1. Add Catalog:
179
+
1. Add the catalog. Replace `$REPO_URL` with the URL that you copied from your GiHub fork:
1. Confirm that the catalog is successfully added and synced:
187
+
1. Confirm that the catalog was successfully added and synced:
182
188
183
189
```azurecli
184
-
az devcenter admin catalog list -d <devcenter name> -o table
190
+
az devcenter admin catalog list -d <devcenterName> -o table
185
191
```
186
192
187
193
## Create an environment type
188
194
189
195
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
196
191
-
1. Create an Environment Type:
197
+
1. Create an environment type:
192
198
193
199
```azurecli
194
-
az devcenter admin environment-type create -d <devcenter name> -n <environment type name>
200
+
az devcenter admin environment-type create -d <devcenterName> -n <environmentTypeName>
195
201
```
196
202
197
-
1. Confirm that the Environment type is created:
203
+
1. Confirm that the environment type was created:
198
204
199
205
```azurecli
200
-
az devcenter admin environment-type list -d <devcenter name> -o table
206
+
az devcenter admin environment-type list -d <devcenterName> -o table
201
207
```
202
208
203
209
## Next steps
204
210
205
211
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
212
207
213
> [!div class="nextstepaction"]
208
-
> [Create and configure a project with Azure CLI](how-to-create-configure-projects.md)
214
+
> [Create and configure a project by using the Azure CLI](how-to-create-configure-projects.md)
0 commit comments