Quickstart: Deploy an Azure Developer CLI template
In this quickstart, you'll learn how to provision and deploy app resources to Azure using an Azure Developer CLI (azd) template and only a few azd commands. azd templates are standard code repositories that include your application source code, as well as azd configuration and infrastructure files to provision Azure resources. To learn more about azd templates and how they can accelerate your Azure provisioning and deployment process see What are Azure Developer CLI templates?.
Select and deploy the template
For the steps ahead, you'll use the following template to provision and deploy an app on Azure:
You can also select a template that matches your preferences from the Awesome AZD template gallery site. Regardless of which template you use, you'll end up with the template code in your development environment and be able to run commands to build, redeploy, and monitor the app in Azure.
Select your preferred environment to continue:
A local development environment is a great choice for traditional development workflows. You'll clone the template repository down onto your device and run commands against a local installation of azd.
Prerequisites
- Install the Azure Developer CLI.
- An Azure account with an active subscription. Create one for free.
- Node.js with npm (v 16.13.1 LTS)
- Review the architecture diagram and the Azure resources you'll deploy in the Node.js template README.
- Install the Azure Developer CLI.
- An Azure account with an active subscription. Create one for free.
- Python 3.8
- Node.js with npm (v 16.13.1 LTS)
- Review the architecture diagram and the Azure resources you'll deploy in the Node.js template README.
- Install the Azure Developer CLI.
- An Azure account with an active subscription. Create one for free.
- .NET 6.0
- Review the architecture diagram and the Azure resources you'll deploy in the Node.js template README.
- Install the Azure Developer CLI.
- An Azure account with an active subscription. Create one for free.
- OpenJDK 17
- Review the architecture diagram and the Azure resources you'll deploy in the Node.js template README.
Initialize the project
In File Explorer or a terminal, create a new empty directory, and change into it.
Run the
azd initcommand and specify the template you want to use as a parameter:azd init --template todo-nodejs-mongoazd init --template todo-python-mongoazd init --template todo-csharp-cosmos-sqlazd init --template todo-java-mongoEnter an environment name when prompted, such as
azdquickstart, which sets a naming prefix for the resource group that will be created to hold the Azure resources. What is an Environment Name inazd?After you specify the environment,
azdclones the template project to your machine and initializes the project.
Provision and deploy the app resources
Run the
azd auth logincommand andazdlaunches a browser for you to complete the sign-in process.azd auth loginRun the
azd upcommand:azd upOnce you are signed-in to Azure, you will be prompted for the following information:
Parameter Description Azure LocationThe Azure location where your resources will be deployed. Azure SubscriptionThe Azure Subscription where your resources will be deployed. Select your desired values and press enter. The
azd upcommand handles the following tasks for you using the template configuration and infrastructure files:- Creates and configures all necessary Azure resources (
azd provision), including: - Access policies and roles for your account
- Service-to-service communication with Managed Identities
- Packages and deploys the code (
azd deploy)
When the
azd upcommand completes successfully, the CLI displays two links to view resources created:- ToDo API app
- ToDo web app frontend
Note
You can call
azd upas many times as you like to both provision and deploy updates to your application. The deployment may due to a resource being undeployable in the selected region. Because this is a quick start, it is safe to delete the.azuredirectory and tryazd upagain. When asked, select a different region. In a more advanced scenario you could selectively edit files within the.azuredirectory to change the region.- Creates and configures all necessary Azure resources (
Clean up resources
When you no longer need the resources created in this article, run the following command to power down the app:
azd down
If you want to redeploy to a different region, delete the .azure directory before running azd up again. In a more advanced scenario you could selectively edit files within the .azure directory to change the region.
Request help
For information on how to file a bug, request help, or propose a new feature for the Azure Developer CLI, please visit the troubleshooting and support page.

