Quickstart: Create and configure a dev center for Azure Deployment Environments
This quickstart shows you how to create and configure a dev center in Azure Deployment Environments.
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 by using environment definitions, connect to individual resources, and deploy applications. To learn more about the components of Azure Deployment Environments, see Key concepts for Azure Deployment Environments.
The following diagram shows the steps you perform in this quickstart to configure a dev center for Azure Deployment Environments in the Azure portal.
First, you create a dev center to organize your deployment environments resources. Next, you create a key vault to store the GitHub personal access token (PAT) that is used to grant Azure access to your GitHub repository. Then, you attach an identity to the dev center and assign that identity access to the key vault. Then, you add a catalog that stores your IaC templates to the dev center. Finally, you create environment types to define the types of environments that development teams can create.
The following diagram shows the steps you perform in the Create and configure a project quickstart to configure a project associated with a dev center for Deployment Environments.
You need to perform the steps in both quickstarts before you can create a deployment environment.
Prerequisites
- An Azure account with an active subscription. Create an account for free.
- Azure role-based access control role with permissions to create and manage resources in the subscription, such as Contributor or Owner.
Create a dev center
To create and configure a Dev center in Azure Deployment Environments by using the Azure portal:
Sign in to the Azure portal.
Search for Azure Deployment Environments, and then select the service in the results.
In Dev centers, select Create.
In Create a dev center, on the Basics tab, select or enter the following information:
Name Value Subscription Select the subscription in which you want to create the dev center. Resource group Either use an existing resource group or select Create new and enter a name for the resource group. Name Enter a name for the dev center. Location Select the location or region where you want to create the dev center. Select Review + Create.
On the Review tab, wait for deployment validation, and then select Create.
You can check the progress of the deployment in your Azure portal notifications.
When the creation of the dev center is complete, select Go to resource.
In Dev centers, verify that the dev center appears.
Create a Key Vault
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. Key Vaults can control access with either access policies or role-based access control (RBAC). If you have an existing key vault, you can use it, but you should check whether it uses access policies or RBAC assignments to control access. In this quickstart, you create an RBAC Key Vault. For help with configuring an access policy for a key vault, see Assign a Key Vault access policy.
If you don't have an existing key vault, use the following steps to create one:
Sign in to the Azure portal.
In the Search box, enter Key Vault.
From the results list, select Key Vault.
On the Key Vault page, select Create.
On the Create key vault tab, provide the following information:
Name Value Name Enter a name for the key vault. Subscription Select the subscription in which you want to create the key vault. Resource group Either use an existing resource group or select Create new and enter a name for the resource group. Location Select the location or region where you want to create the key vault. Leave the other options at their defaults.
On the Access configuration tab, select Azure role-based access control, and then select Review + create.
On the Review + create tab, select Create.
Create a personal access token
Using an authentication token like a GitHub PAT enables you to share your repository securely. GitHub offers classic PATs, and fine-grained PATs. Fine-grained and classic PATs work with Azure Deployment Environments, but fine-grained tokens give you more granular control over the repositories to which you're allowing access.
Tip
If you are attaching an Azure DevOps repository, use these steps: Create a personal access token in Azure DevOps.
In a new browser tab, sign into your GitHub account.
On your profile menu, select Settings.
On your account page, on the left menu, select < >Developer Settings.
On the Developer settings page, select Fine-grained tokens.
On the Fine-grained personal access tokens page, select Generate new token
On the New fine-grained personal access token page, provide the following information:
Name Value Token name Enter a descriptive name for the token. Expiration Select the token expiration period in days. Description Enter a description for the token. Repository access Select Public Repositories (read-only). Leave the other options at their defaults.
Select Generate token.
On the Fine-grained personal access tokens page, copy the new token.
Warning
You must copy the token now. You will not be able to access it again.
Switch back to the Key Vault – Microsoft Azure browser tab.
In the Key Vault, on the left menu, select Secrets.
On the Secrets page, select Generate/Import.
On the Create a secret page:
- In the Name box, enter a descriptive name for your secret.
- In the Secret value box, paste the GitHub secret you copied in step 7.
- Select Create.
Leave this tab open, you need to come back to the Key Vault later.
Attach an identity to the dev center
After you create a dev center, attach an identity to the dev center. You can attach either a system-assigned managed identity or a user-assigned managed identity. Learn about the two types of identities.
In this quickstart, you configure a system-assigned managed identity for your dev center.
Attach a system-assigned managed identity
To attach a system-assigned managed identity to your dev center:
In Dev centers, select your dev center.
In the left menu under Settings, select Identity.
Under System assigned, set Status to On, and then select Save.
In the Enable system assigned managed identity dialog, select Yes.
Assign the system-assigned managed identity access to the key vault secret
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 (RBAC) or Vault access policy. In this quickstart, you use an RBAC key vault.
Configure vault access:
In the Azure portal, go to the key vault that contains the secret with the personal access token.
In the left menu, select Access control (IAM).
Select Add > Add role assignment.
Assign the following role. For detailed steps, see Assign Azure roles using the Azure portal.
Setting Value Role Select Key Vault Secrets User. Assign access to Select Managed identity. Members Select the dev center managed identity that you created in Attach a system-assigned managed identity.
Add a catalog to the dev center
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.
In this quickstart, you attach a GitHub repository that contains samples created and maintained by the Azure Deployment Environments team.
To add a catalog to your dev center, you first need to gather some information.
Gather GitHub repo information
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, and paste it somewhere accessible, like notepad.
Tip
If you are attaching an Azure DevOps repository, use these steps: Get the clone URL of an Azure DevOps repository.
On your GitHub account page, select <> Code, and then select copy.
Take a note of the branch that you're working in.
Take a note of the folder that contains your environment definitions.
Gather the secret identifier
You also need the path to the secret you created in the key vault.
In the Azure portal, navigate to your key vault.
On the key vault page, from the left menu, select Secrets.
On the Secrets page, select the secret you created earlier.
On the versions page, select the CURRENT VERSION.
On the current version page, for the Secret identifier, select copy.
Add a catalog to your dev center
Navigate to your dev center.
In the left menu under Environment configuration, select Catalogs, and then select Add.
In Add catalog, enter the following information, and then select Add:
Field Value Name Enter a name for the catalog. Git clone URI Enter or paste the clone URL for either your GitHub repository or your Azure DevOps repository.
Sample catalog example:https://github.com/Azure/deployment-environments.git
Branch Enter the repository branch to connect to.
Sample catalog example:main
Folder path Enter the folder path relative to the clone URI that contains subfolders that hold your environment definitions.
The folder path is for the folder with subfolders containing environment definition manifests, not for the folder with the environment definition manifest itself. The following image shows the sample catalog folder structure.
Sample catalog example:/Environments
The folder path can begin with or without a forward slash (
/
).Secret identifier Enter the secret identifier that contains your personal access token for the repository.
When you copy a secret identifier, the connection string includes a version identifier at the end, like in this example:https://contoso-kv.vault.azure.net/secrets/GitHub-repo-pat/9376b432b72441a1b9e795695708ea5a
.
Removing the version identifier ensures that Deployment Environments fetches the latest version of the secret from the key vault. If your personal access token expires, only the key vault needs to be updated.
Example secret identifier:https://contoso-kv.vault.azure.net/secrets/GitHub-repo-pat
In Catalogs for the dev center, verify that your catalog appears. If the connection is successful, Status is Connected.
Create an environment type
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.
In the Azure portal, go to Azure Deployment Environments.
In Dev centers, select your dev center.
In the left menu under Environment configuration, select Environment types, and then select Create.
In Create environment type, enter the following information, and then select Add.
Name Value Name Enter a name for the environment type. Tags Enter a tag name and a tag value. Confirm that the environment type is added by checking your Azure portal notifications.
An environment type that you add to your dev center is available in each project in the dev center, but environment types aren't enabled by default. When you enable an environment type at the project level, the environment type determines the managed identity and subscription that are used to deploy environments.
Next steps
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.
Feedback
Submit and view feedback for