Get started using Azure Developer CLI (azd) Preview

In this article, you'll learn the basic commands for using the Azure Developer CLI (azd) Preview.

We'll use the ToDo Application with a Node.js API and Azure Cosmos DB API for MongoDB for this tutorial. Upon completion, you'll get the code in your development environment and will be able to run commands to build, deploy, and monitor the app in Azure.

For more information including architecture diagram and the Azure resources you'll deploy, see the README.

We'll use the ToDo Application with a Python API and Azure Cosmos DB API for MongoDB for this tutorial. Upon completion, you'll get the code in your development environment and will be able to run commands to build, deploy, and monitor the app in Azure.

For more information including architecture diagram and the Azure resources you'll deploy, see the README.

We'll use the ToDo Application with a C# API and Azure Cosmos DB SQL API for this tutorial. Upon completion, you'll get the code in your development environment and will be able to run commands to build, deploy, and monitor the app in Azure.

For more information including architecture diagram and the Azure resources you'll deploy, see the README.

Configure your development environment

To run any sample template, pick a development environment. For more information about the pros and cons of the different development environment choices, see Azure Developer CLI (azd) supported environments.

In this article, you create infrastructure and deploy code to Azure. If you don't have an Azure Subscription, sign up for a free account.

Once you've selected a development environment, select one of the following tabs:

Prerequisites

Before you get started, ensure you have the following tools installed on your local machine:

Python virtual environment

This app uses Python Virtual Environments to isolate Python package installations. Make sure you create and activate a virtual environment.

Run up command

The fastest way for you to get this app up and running on Azure is to use the azd up command. This single command will download code, initialize the project, create and configure all necessary Azure resources - including access policies and roles for your account and service-to-service communication with Managed Identities.

  1. In File Explorer or a terminal, create a new empty directory, and change into it.

  2. Run the following command:

azd up --template todo-nodejs-mongo
azd up --template todo-python-mongo
azd up --template todo-csharp-cosmos-sql

The command prompts for the following information:

  • Environment Name: Prefix for the resource group that will be created to hold all Azure resources.
  • Azure Location: The Azure location where your resources will be deployed.
  • Azure Subscription: The Azure Subscription where your resources will be deployed.

A progress indicator displays the current status azd provisions and deploys your app.

Note

  • The operation could take several minutes to complete as it performs three steps: initializes the project (azd init), creates the Azure services (azd provision), and deploys the code (azd deploy).

Once the azd up command completes, it displays several URLs:

  • Azure portal link to view resources created
  • ToDo web app frontend
  • ToDo API app

Screenshot of command output listing endpoint URLs."

What happened?

Upon successful completion of the azd up command, you'll note several changes to your environment:

  • A local clone of the repo referenced by the azd template has been created in the directory where you ran azd up.
  • The Azure resources referenced in the templates README.md file have been provisioned to the Azure subscription you specified when you ran azd up. You can view those Azure resources using the Azure portal.
  • The app has been built and deployed to Azure. Using the web app URL output from the azd up command, you can browse to the fully functional app.

Note

  • You can call azd up as many times as you like to both provision and deploy your solution, but you only need to provide the --template parameter the first time you call it to get the code locally. Subsequent azd up calls do not require the template parameter. If you do provide the parameter, all your local source code will be overwritten if you agree to overwrite when prompted.
  • You can always create a new environment with azd env new.

Clean up resources

When you no longer need the resources created in this article, do the following steps:

azd down

Troubleshooting/Known issues

Next steps