Azure Deployment Environments empowers development teams to quickly and easily spin up app infrastructure with project-based templates that establish consistency and best practices while maximizing security. This on-demand access to secure environments accelerates the stages of the software development lifecycle in a compliant and cost-efficient way.
This repo uses the Azure Developer CLI to bootstrap a DevCenter resource with the minimun configuration required to start using Azure Deployment Environments.
Learn more about the key concepts for Azure Deployment Environments.
A deployment environment is a preconfigured collection of Azure resources deployed in predefined subscriptions. Azure governance is applied to those subscriptions based on the type of environment, such as sandbox, testing, staging, or production.
With Azure Deployment Environments, your platform engineers can enforce enterprise security policies and provide a curated set of predefined infrastructure as code (IaC) templates. Your developers will use those templates to deploy environments on demand in a self-service manner.
Note: Azure Deployment Environments currently supports only Azure Resource Manager (ARM) templates and Terraform (Private Preview).
This repo will deploy several Azure resources and configure DevCenter to let you start exploring Azure Deployment Environments. The following resources will be deployed:
- A resource group
- An Azure DevCenter resource
- An Azure Key Vault resource to store the GitHub token to connect to the catalog
- Sample DevCenter environment types (development, sandbox, etc.)
- Sample DevCenter projects (Team-one, Team-two, etc.)
- Projects environment types definitions (development, sandbox)
The projects and environments defined serve as inspiration to start using Azure Deployment Environments, you can delete them and create your own.
All azure resources are defined as code using Terraform, the environment definition can be found in the infra
folder.
Let's get started!
Make sure you have the following tools installed:
- Azure CLI
- Azure Developer CLI
- Terraform CLI
- An Azure subscription with at least
Owner
RBAC role assigned to the deployment identity
Note: Before starting, create a GitHub PAT with
repo
scope to connect to a GitHub repository as a catalog. Learn more about creating a GitHub PAT.
- Define the following environment variables which will be used to link a GitHub repository as a DevCenter catalog. A catalog is the repository that contains the environment definitions as infrastructure as code templates. Use the Azure official repo for Azure Deployment Environments to import sample environments.
# Bash
export GITHUB_TOKEN=<github_token>
export GITHUB_OWNER=<github_owner> # Use 'Azure' to use Microsoft official catalog
export GITHUB_REPO=<github_repo> # Use 'deployment-environments' to use Microsoft official catalog
PowerShell:
# PowerShell
$env:GITHUB_TOKEN="<github_token>"
$env:GITHUB_OWNER="<github_owner>" # Use 'Azure' to use Microsoft official catalog
$env:GITHUB_REPO="<github_repo>" # Use 'deployment-environments' to use Microsoft official catalog
- Run
azd up
from the root folder of this repository and follow the prompts to bootstrap your DevCenter. - Go to the Developer Portal and start creating environments.
Once Azure Deployment Environments is deployed and configured, you can start creating environments in the Developer Portal. The following screenshot shows the Developer Portal with the sample environments and projects deployed with this repo.
Alternatively, you can deploy environments using the Azure CLI. Learn more about the Azure Deployment Environments CLI or CI/CD pipelines.
- Azure Deployment Environments Docs
- Azure Deployment Environments GitHub repo
- Microsoft Build 2023 session: Self-serve app infrastructure using Azure Deployment Environments
This project welcomes contributions and suggestions. Submit a pull request with your changes!
If you have any feature requests, issues, or areas for improvement, please file an issue.