{"id":2109,"date":"2022-07-12T10:03:03","date_gmt":"2022-07-12T17:03:03","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=2109"},"modified":"2022-08-24T08:46:17","modified_gmt":"2022-08-24T15:46:17","slug":"introducing-the-azure-developer-cli-a-faster-way-to-build-apps-for-the-cloud","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/introducing-the-azure-developer-cli-a-faster-way-to-build-apps-for-the-cloud\/","title":{"rendered":"Introducing the Azure Developer CLI (azd): A faster way to build apps for the cloud"},"content":{"rendered":"<p>Today, we\u2019re excited to announce the public preview of the <a href=\"https:\/\/github.com\/Azure\/azure-dev\">Azure Developer CLI<\/a> (<code>azd<\/code>) \u2014a new, open-source tool that accelerates the time it takes to get started on Azure. The Azure Developer CLI provides developer-friendly commands that map to key stages in your workflow: code, build, deploy, monitor, repeat. To create, provision, and deploy a new application in one step, it\u2019s as easy as:<\/p>\n<p><code>azd up --template todo-nodejs-mongo<\/code><\/p>\n<p>You can use the Azure Developer CLI with extensible templates that include everything you need to get an application up and running in Azure. The templates include best practices, application code and reusable infrastructure as code assets.<\/p>\n<p>The new Azure Developer CLI builds upon the experience and foundations of the <a href=\"https:\/\/docs.microsoft.com\/cli\/azure\/\">Azure CLI<\/a>. You can use both tools together, as needed, to support your Azure workflow.<\/p>\n<p>For a quick intro to the Azure Developer CLI, be sure to check out\u00a0<a href=\"https:\/\/aka.ms\/azure-dev\/devhub\">our Developer Hub<\/a>!<\/p>\n<h2>A tool to help developers write code for the cloud<\/h2>\n<p>As a developer, you need to make many decisions when it comes to building, deploying, and securing your application. Some questions you might ask are:<\/p>\n<ul>\n<li>Which <strong>cloud services<\/strong> should I use with my code?<\/li>\n<li>Which <strong>libraries<\/strong> do I need to use?<\/li>\n<li>How should I set up my <strong>local development environment<\/strong>?<\/li>\n<li>How do I provision the necessary <strong>infrastructure<\/strong> for my application?<\/li>\n<li>How do I know that what I\u2019m doing incorporates <strong>security best practices<\/strong>?<\/li>\n<\/ul>\n<p>The Azure Developer CLI helps you answer these questions. It provides you with a clear path for building your application in the cloud.<\/p>\n<p>With the Azure Developer CLI, a typical developer workflow looks like this:<\/p>\n<ol>\n<li><code>azd init<\/code>: Create an application and initialize an environment using a sample template in your preferred language.<\/li>\n<li><code>azd provision<\/code>: Provision the necessary resources for your application on Azure.<\/li>\n<li><code>azd deploy<\/code>: Deploy your application to Azure.<\/li>\n<li><code>azd monitor<\/code>: Monitor your application&#8217;s behavior and performance and validate deployments.<\/li>\n<li><code>azd pipeline config<\/code>: Create and manage CI\/CD (continuous integration and continuous delivery).<\/li>\n<\/ol>\n<p>Better yet, you can also use <code>azd up<\/code> to create, provision, and deploy a new application in one step! For a list of supported commands, see the <a href=\"https:\/\/aka.ms\/azure-dev\/ref\">Developer CLI reference docs<\/a>. Alternatively, run <code>azd \u2013h<\/code> from your preferred terminal after installation. If you no longer want or need the resources you&#8217;ve created, you can run <code>azd down<\/code>.<\/p>\n<p>Whether you\u2019re working in the terminal, your editor or IDE (like Visual Studio Code or Visual Studio), or your GitHub Actions pipeline, Azure Developer CLI commands remain consistent regardless of the context. There\u2019s no magic or behind-the-scenes work being done here!<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-content\/uploads\/sites\/58\/2022\/07\/azd-developer-workflow.gif\" alt=\"\" \/><\/p>\n<h2>Application templates for Python, JavaScript\/TypeScript, and C#<\/h2>\n<p>The Azure Developer CLI uses idiomatic application templates that extend beyond \u201cHello World!\u201d to include the scaffolding for monitoring and CI\/CD for your application.<\/p>\n<p>Each template includes application code, an <code>\/infra<\/code> directory containing all the infra-as-code files (written in <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-resource-manager\/bicep\/overview?tabs=bicep\">Bicep<\/a>) needed to provision the Azure resources, and an <em>azure.yaml<\/em> file that describes your application. These templates are extensible and customizable to your specific use case.<\/p>\n<p>For our first preview, we\u2019ve authored an initial set of template applications written in Python, JavaScript\/TypeScript, and C# and for hosts such as Azure App Service, Azure Container Apps, and Azure Static Web Apps + Function Apps. Check out <a href=\"https:\/\/aka.ms\/azure-dev\/templates\">our growing list of templates<\/a>.<\/p>\n<p>For information on authoring your own template or &#8220;templatizing&#8221; an existing application, see <a href=\"https:\/\/aka.ms\/azure-dev\/enabletemplate\">our Developer Hub<\/a>.<\/p>\n<h2>Get started with the Azure Developer CLI<\/h2>\n<h3>Installation Instructions<\/h3>\n<p><a href=\"https:\/\/aka.ms\/azure-dev\/get-started\">Once you\u2019ve installed the prerequisites<\/a>, install the standalone Azure Developer CLI via the following command in your preferred terminal.<\/p>\n<h4>Windows<\/h4>\n<p><code>powershell -ex AllSigned -c \"Invoke-RestMethod 'https:\/\/aka.ms\/install-azd.ps1' | Invoke-Expression\"<\/code><\/p>\n<h4>macOS\/Linux<\/h4>\n<p><code>curl -fsSL https:\/\/aka.ms\/install-azd.sh | bash<\/code><\/p>\n<h2>Editor and IDE Support<\/h2>\n<h3>Visual Studio Code<\/h3>\n<p>As of today, you can also access preview Azure Developer CLI functionality from within both Visual Studio Code and Visual Studio. You can try out our <a href=\"https:\/\/aka.ms\/azure-dev\/vscode-ext\">Visual Studio Code extension<\/a> by installing it from the Visual Studio Code Marketplace. From the VS Code extension, you can use all the Azure Developer CLI commands.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-content\/uploads\/sites\/58\/2022\/07\/azd-vscode.gif\" alt=\"\" \/><\/p>\n<h3>Visual Studio<\/h3>\n<p>In Visual Studio 2022 17.3 Preview 2 or later, you can enable the CLI by flipping the <strong>Integration with azd, the Azure Developer CLI<\/strong> preview feature flag (<strong>Tools<\/strong> &gt; <strong>Options<\/strong> &gt; <strong>Environment<\/strong> &gt; <strong>Preview Features<\/strong> &gt; <strong>Integration with azd, the Azure Developer CLI<\/strong>). Enabling this flag will enable Visual Studio to detect the presence of a solution that was created with the Azure Developer CLI in the terminal.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-content\/uploads\/sites\/58\/2022\/07\/azd-vs.png\" alt=\"\" \/><\/p>\n<h2>What&#8217;s next for the Azure Developer CLI?<\/h2>\n<p>During public preview, we want to hear from you and learn how we can continue to improve the developer experience of building on Azure. We\u2019re also currently prioritizing adding support for the following based on feedback that we\u2019ve received during our private preview:<\/p>\n<ul>\n<li>Java language templates<\/li>\n<li>Azure Kubernetes Service templates<\/li>\n<li>Azure Pipelines support<\/li>\n<li>Terraform support<\/li>\n<\/ul>\n<h2>Feedback + Contributions<\/h2>\n<h3>Contributing to the CLI<\/h3>\n<p>The Developer CLI is an open-source, MIT-licensed product! Our team is excited to collaborate with all of you and intends for the Azure Developer CLI to be community-driven. We welcome contributions to the core Developer CLI codebase and in the form of templates. Our team encourages you to file issues, open pull requests, contribute to discussions and more via our <a href=\"https:\/\/github.com\/Azure\/azure-dev\">GitHub repository<\/a>.<\/p>\n<h3>Authoring Templates<\/h3>\n<p>Our team has created templates for some key Python, JavaScript\/TypeScript, and C#. We also plan to author more in the future to cover even more developer scenarios. If you author your own templates, you can add the <code>azd-templates<\/code> tag to your repository on GitHub. That way, other developers can find, fork, and build upon your template for their own use case. You can also open an issue on our <a href=\"https:\/\/github.com\/Azure\/azure-dev\">GitHub repository<\/a> if there&#8217;s a use case and template that you would like to see created.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post announces the preview release of the Azure Developer CLI. The Azure Developer CLI accelerates the time it takes to get started on Azure.<\/p>\n","protected":false},"author":95415,"featured_media":2111,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[701,864,159,162,733],"class_list":["post-2109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-net","tag-azure-developer-cli","tag-javascript","tag-python","tag-typescript"],"acf":[],"blog_post_summary":"<p>This post announces the preview release of the Azure Developer CLI. The Azure Developer CLI accelerates the time it takes to get started on Azure.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/2109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/users\/95415"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/comments?post=2109"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/2109\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/2111"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=2109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=2109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=2109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}