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. Visit the What are Azure Developer CLI templates? page to learn more about azd
templates and how they can accelerate your Azure provisioning and deployment process.
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 init
command and specify the template you want to use as a parameter:azd init --template todo-nodejs-mongo
azd init --template todo-python-mongo
azd init --template todo-csharp-cosmos-sql
azd init --template todo-java-mongo
Enter 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,
azd
clones the template project to your machine and initializes the project.
Provision and deploy the app resources
Run the
azd auth login
command andazd
launches a browser for you to complete the sign-in process.azd auth login
Run the
azd up
command:azd up
Once you are signed-in to Azure, you will be prompted for the following information:
Parameter Description Azure Location
The Azure location where your resources will be deployed. Azure Subscription
The Azure Subscription where your resources will be deployed. Select your desired values and press enter. The
azd up
command 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 up
command completes successfully, the CLI displays two links to view resources created:- ToDo API app
- ToDo web app frontend
Note
You can call
azd up
as many times as you like to both provision and deploy updates to your application.- 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
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.
Next steps
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for