Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The Azure Developer CLI is designed around a powerful template system that streamlines deploying and provisioning Azure resources. While developing with azd
, you have the option to either build your own template, or choose from a configurable list of existing templates. In this article, you learn how to work with template lists and configure your local azd
installation to support different template list sources.
An azd
template source points to a JSON configuration file that describes a list of available templates and their essential metadata, such as the name, description, and location of the template source code (usually a GitHub repo). When you enable a template source, the templates it defines are made available to azd
through other commands. For example, the template source JSON snippet below defines two templates:
[
{
"name": "Starter - Bicep",
"description": "A starter template with Bicep as infrastructure provider",
"repositoryPath": "azd-starter-bicep",
"tags": ["bicep"]
},
{
"name": "Starter - Terraform",
"description": "A starter template with Terraform as infrastructure provider",
"repositoryPath": "azd-starter-terraform",
"tags": ["terraform"]
}
]
Each template entry in the JSON configuration file includes the following properties:
azd init --filter <tag>
and azd template list --filter <tag>
.For a full example, see this JSON file, which is the default template source included in azd
.
azd
allows you to enable multiple template sources at a time. The following template source options are currently available to choose from:
azd
provides several commands to configure template sources.
Use the azd template source list
command to list all currently configured template sources:
azd template source list
Example output with two configured template sources:
Key Name Type Location
awesome-azd Awesome AZD awesome-azd https://aka.ms/awesome-azd/templates.json
default Default resource
Use the azd template source add
command to add a new template source. This command accepts the following parameters:
azd template source add <key> --type <file-or-url-or-gh> --location <your-uri> --name <your-display-name>
Use the azd template source remove
command to remove a template source:
azd template source remove <key>
Use the azd config reset
command to reset the template configuration back to default settings:
azd config reset
After you configure your template sources, use the azd template list
command to list the available templates from those sources:
azd template list
For example, a default installation of azd
lists the following templates from the awesome-azd template source:
Name Source Repository Path
Event Driven Java Application with Azure Service Bus Awesome AZD Azure-Samples/ASA-Samples-Event-Driven-Application
Static React Web App with Java API and PostgreSQL Awesome AZD Azure-Samples/ASA-Samples-Web-Application
SAP CAP on Azure App Service Quickstart Awesome AZD Azure-Samples/app-service-javascript-sap-cap-quickstart
SAP Cloud SDK on Azure App Service Quickstart (TypeScript) Awesome AZD Azure-Samples/app-service-javascript-sap-cloud-sdk-quickstart
Java Spring Apps with Azure OpenAI Awesome AZD Azure-Samples/app-templates-java-openai-springapps
WordPress with Azure Container Apps Awesome AZD Azure-Samples/apptemplate-wordpress-on-ACA
Bicep template to bootstrap Azure Deployment Environments Awesome AZD Azure-Samples/azd-deployment-environments
Starter - Bicep Awesome AZD Azure-Samples/azd-starter-bicep
Starter - Terraform Awesome AZD Azure-Samples/azd-starter-terraform
...
# Additional templates omitted
Include the --source
flag to only list templates from a specific source:
azd template list --source <source-name>
To initialize a template from the displayed list, run the azd init
command and provide the repository path of the template:
azd init --template <path-value>
The Azure Developer CLI (azd
) also provides support for Azure Deployment Environments. An Azure Deployment Environment (ADE) 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 can enforce enterprise security policies and provide a curated set of predefined infrastructure as code (IaC) templates.
ADE integration is beyond the scope of this article. Learn more about configuring ade
support in the Azure Developer CLI support for Azure Deployment Environments documentation.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Learning path
Build and deploy applications with the Azure Developer CLI - Training
This learning path teaches developers how to use the Azure Developer CLI and its template system to build, configure and deploy applications.
Certification
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
Documentation
Customize your Azure Developer CLI workflows using command and event hooks
Explores how to use Azure Developer CLI hooks to customize deployment pipelines
Explore azd config functionality
Learn how to use the azd config command and related functionality
Get started with the Azure Developer CLI compose feature
How to compose and build your apps using the Azure Developer CLI compose feature