Skip to content

Commit 052d5cd

Browse files
authored
Merge pull request #259846 from cdpark/quickstarts-cli-renato
Freshness pass 167585: Azure Deployment Environments -- CLI quickstarts
2 parents b003752 + 1f66dd6 commit 052d5cd

File tree

2 files changed

+82
-76
lines changed

2 files changed

+82
-76
lines changed
Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
---
22
title: Create and configure a dev center for Azure Deployment Environments by using the Azure CLI
33
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.
55
author: renato-marciano
66
ms.author: remarcia
77
ms.service: deployment-environments
88
ms.custom: devx-track-azurecli, build-2023
99
ms.topic: quickstart
10-
ms.date: 04/28/2023
10+
ms.date: 11/29/2023
1111
---
1212

1313
# Create and configure a dev center for Azure Deployment Environments by using the Azure CLI
1414

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.
1816

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.
1918

2019
## Prerequisites
2120

2221
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2322
- 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.
2725

2826
## 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:
3029

3130
1. Sign in to the Azure CLI:
3231

3332
```azurecli
3433
az login
3534
```
3635
37-
1. Install the Azure Dev Center extension for the CLI.
36+
1. Install the Azure CLI *devcenter* extension.
3837
3938
```azurecli
4039
az extension add --name devcenter --upgrade
@@ -43,10 +42,10 @@ To create and configure a Dev center in Azure Deployment Environments by using t
4342
1. Configure the default subscription as the subscription in which you want to create the dev center:
4443

4544
```azurecli
46-
az account set --subscription <name>
45+
az account set --subscription <subscriptionName>
4746
```
4847

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&regions=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&regions=all):
5049

5150
```azurecli
5251
az configure --defaults location=eastus
@@ -55,31 +54,31 @@ To create and configure a Dev center in Azure Deployment Environments by using t
5554
1. Create the resource group in which you want to create the dev center:
5655

5756
```azurecli
58-
az group create -n <group name>
57+
az group create -n <resourceGroupName>
5958
```
6059

6160
1. Configure the default resource group as the resource group you created:
6261

6362
```azurecli
64-
az config set defaults.group=<group name>
63+
az config set defaults.group=<resourceGroupName>
6564
```
6665

6766
1. Create the dev center:
6867

6968
```azurecli
70-
az devcenter admin devcenter create -n <devcenter name>
69+
az devcenter admin devcenter create -n <devcenterName>
7170
```
7271

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:
7473

7574
```output
7675
{
7776
"devCenterUri": "https://...",
78-
"id": "/subscriptions/.../<devcenter name>",
77+
"id": "/subscriptions/.../<devcenterName>",
7978
"location": "eastus",
8079
"name": "<devcenter name>",
8180
"provisioningState": "Succeeded",
82-
"resourceGroup": "<group name>",
81+
"resourceGroup": "<resourceGroupName>",
8382
"systemData": {
8483
"createdAt": "...",
8584
"createdBy": "...",
@@ -92,24 +91,25 @@ To create and configure a Dev center in Azure Deployment Environments by using t
9291
> [!NOTE]
9392
> 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.
9493
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.
9797

98-
1. Create a Key Vault:
98+
1. Create a key vault:
9999

100100
```azurecli
101101
# Change the name to something Globally unique
102-
az keyvault create -n <kv name>
102+
az keyvault create -n <keyvaultName>
103103
```
104104

105105
> [!NOTE]
106-
> You may get the following Error:
106+
> You might get the following error:
107107
`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.
108108

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:
110110

111111
```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>
113113
```
114114

115115
## Attach an identity to the dev center
@@ -118,91 +118,96 @@ After you create a dev center, attach an [identity](concept-environments-key-con
118118

119119
In this quickstart, you configure a system-assigned managed identity for your dev center.
120120

121-
## Attach a system-assigned managed identity
121+
### Attach a system-assigned managed identity
122122

123123
To attach a system-assigned managed identity to your dev center:
124124

125125
```azurecli
126-
az devcenter admin devcenter update -n <devcenter name> --identity-type SystemAssigned
126+
az devcenter admin devcenter update -n <devcenterName> --identity-type SystemAssigned
127127
```
128128

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
131130

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:
133134

134135
```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)
136137
echo $OID
137138
```
138139

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:
140141

141142
```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
143144
```
144145

145146
## 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.
147149

148150
In this quickstart, you attach a GitHub repository that contains samples created and maintained by the Azure Deployment Environments team.
149151

150152
To add a catalog to your dev center, you first need to gather some information.
151153

152154
### Gather GitHub repo information
155+
153156
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.
154157

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+
155160
> [!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).
157162
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.
160165
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":::
163168

164169
### Add a catalog to your dev center
165170

166171
1. Retrieve the secret identifier:
167-
172+
168173
```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)
170175
echo $SECRETID
171176
```
172177

173-
1. Add Catalog:
178+
1. Add the catalog.
174179

175180
```azurecli
176-
# Sample Catalog example
181+
# Sample catalog example
177182
REPO_URL="https://github.com/Azure/deployment-environments.git"
178-
az devcenter admin catalog create --git-hub path="/Environments" branch="main" secret-identifier=$SECRETID uri=$REPO_URL -n <catalog name> -d <devcenter name>
183+
az devcenter admin catalog create --git-hub path="/Environments" branch="main" secret-identifier=$SECRETID uri=$REPO_URL -n <catalogName> -d <devcenterName>
179184
```
180185

181-
1. Confirm that the catalog is successfully added and synced:
186+
1. Confirm that the catalog was successfully added and synced:
182187

183188
```azurecli
184-
az devcenter admin catalog list -d <devcenter name> -o table
189+
az devcenter admin catalog list -d <devcenterName> -o table
185190
```
186191

187192
## Create an environment type
188193

189194
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.
190195

191-
1. Create an Environment Type:
196+
1. Create an environment type:
192197

193198
```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>
195200
```
196201

197-
1. Confirm that the Environment type is created:
202+
1. Confirm that the environment type was created:
198203

199204
```azurecli
200-
az devcenter admin environment-type list -d <devcenter name> -o table
205+
az devcenter admin environment-type list -d <devcenterName> -o table
201206
```
202207

203208
## Next steps
204209

205210
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.
206211

207212
> [!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

Comments
 (0)