{"id":2433,"date":"2023-02-08T15:43:30","date_gmt":"2023-02-08T23:43:30","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=2433"},"modified":"2023-02-15T09:29:17","modified_gmt":"2023-02-15T17:29:17","slug":"azure-developer-cli-azd-february-2023-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/azure-developer-cli-azd-february-2023-release\/","title":{"rendered":"Azure Developer CLI (azd) &#8211; February 2023 Release"},"content":{"rendered":"<p>We&#8217;re pleased to announce that the February 2023 release (<code>0.6.0-beta.1<\/code>) of the Azure Developer CLI (<code>azd<\/code>) is now available. You can learn about how to get started with the Azure Developer CLI by visiting our <a href=\"https:\/\/aka.ms\/azd\">Dev Hub<\/a>.<\/p>\n<p>This release includes the following features and improvements:<\/p>\n<ul>\n<li>Support for command and service hooks (<a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1429\">azure-dev#1429<\/a>)<\/li>\n<li>Support for installation via Homebrew, Windows Package Manager, and Chocolatey (<a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\/1383\">azure-dev#1383<\/a>, <a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\/1382\">azure-dev#1382<\/a>,<a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\/744\"> azure-dev#744<\/a>)<\/li>\n<li>Support for multiple Azure organizations <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1478\">(azure-dev#1478)<\/a><\/li>\n<li>New Templates &#8211; Dapr, Python, JavaScript and Java!<\/li>\n<\/ul>\n<p>If you&#8217;re interested, we&#8217;re also hosting a community standup on February 16 at 11:00am PT on the Azure Developers <a href=\"https:\/\/www.youtube.com\/watch?v=eN7P9DO0cHo\">YouTube<\/a> and <a href=\"https:\/\/www.twitch.tv\/azuredevelopers\">Twitch<\/a> channels. Hope to see you all there!<\/p>\n<h2>Support for command and service hooks<\/h2>\n<p>We&#8217;re excited to announce that as of this release you&#8217;re now able to even further customize your workflow via new command and service hooks. In chatting with our users, we&#8217;d heard feedback that sometimes you want to execute some task or script pre- or post- <code>azd<\/code> command or service event. With this feedback in mind, we&#8217;ve added the ability for you to execute scripts or commands from within your project&#8217;s <code>azure.yaml<\/code>.<\/p>\n<h3>Available hooks<\/h3>\n<p>The following <code>azd<\/code> command hooks are now available:<\/p>\n<ul>\n<li><code>prerestore<\/code> and <code>postrestore<\/code>: Run before and after package dependencies are restored.<\/li>\n<li><code>preprovision<\/code> and <code>postprovision<\/code>: Run before and after Azure resources are created.<\/li>\n<li><code>predeploy<\/code> and <code>postdeploy<\/code>: Run before and after the application code is deployed to Azure.<\/li>\n<li><code>preup<\/code> and <code>postup<\/code>: Run before and after the combined deployment pipeline. <code>Up<\/code> is a shorthand command that runs <code>restore<\/code>, <code>provision<\/code>, and <code>deploy<\/code> sequentially.<\/li>\n<li><code>predown<\/code> and <code>postdown<\/code>: Run before and after the resources are removed.<\/li>\n<\/ul>\n<p>The following service lifecycle event hooks are available:<\/p>\n<ul>\n<li><code>prerestore<\/code> and <code>postrestore<\/code>: Run before and after the service packages and dependencies are restored.<\/li>\n<li><code>prepackage<\/code> and <code>postpackage<\/code>: Run before and after the app is packaged for deployment.<\/li>\n<li><code>predeploy<\/code> and <code>postdeploy<\/code>: Run before and after the service code is deployed to Azure.<\/li>\n<\/ul>\n<p>Here&#8217;s an example of how to configure both an inline script on pre-<code>restore<\/code> and an external script on pre-<code>provision<\/code> using this new feature:<\/p>\n<pre><code class=\"language-yaml\">name: todo-nodejs-mongo\r\nmetadata:\r\n  template: todo-nodejs-mongo@0.0.1-beta\r\nhooks:\r\n  prerestore: # Example of an inline script. (shell is required for inline scripts)\r\n    shell: sh\r\n    run: echo 'Hello'\r\n  preprovision: # Example of external script (Relative path from project root)\r\n    run: .\/hooks\/preprovision.sh\r\nservices:\r\n  web:\r\n    project: .\/src\/web\r\n    dist: build\r\n    language: js\r\n    host: appservice\r\n  api:\r\n    project: .\/src\/api\r\n    language: js\r\n    host: appservice<\/code><\/pre>\n<p>To learn more about our new hooks support and see examples, check out <a href=\"https:\/\/aka.ms\/azd-hooks\">this article<\/a> on our DevHub.<\/p>\n<h2>Support for installation via Homebrew, Windows Package Manager and Chocolatey<\/h2>\n<p>We&#8217;ve been teasing support for installing <code>azd<\/code> via your favorite package managers for a couple releases now so we&#8217;re excited to announce we&#8217;re shipping support for Homebrew (<code>brew<\/code>), Windows Package Manager (<code>winget<\/code>), and Chocolatey (<code>choco<\/code>) in the latest release of the CLI.<\/p>\n<p>You can now install <code>azd<\/code> via:<\/p>\n<ul>\n<li><code>brew tap azure\/azd &amp;&amp; brew install azd<\/code><\/li>\n<li><code>winget install microsoft.azd<\/code><\/li>\n<li><code>choco install azd<\/code><\/li>\n<\/ul>\n<p>If your favorite package manager isn&#8217;t yet supported, you can continue to follow the instructions at <a href=\"https:\/\/aka.ms\/azd-install\">aka.ms\/azd-install<\/a>. We&#8217;re also working on supporting installation via <code>apt<\/code> and <code>yum<\/code> so stay tuned for that support in an upcoming release.<\/p>\n<h2>Support for multiple Azure organizations<\/h2>\n<p>Subscriptions from all organizations of the user are now listed when <code>azd init<\/code> prompts for subscriptions.<\/p>\n<p>All <code>azd<\/code> commands also support running against environments from different organizations seamlessly. Previous workarounds that required <code>auth.useAzCliAuth<\/code> set to <code>true<\/code> should no longer be required. If you use subscriptions from multiple Azure organizations and have feedback on this new experience, let us know!<\/p>\n<h2>New Templates &#8211; Dapr, Python, JavaScript and Java!<\/h2>\n<p>Since our last release, we also have some awesome new templates to highlight! As a reminder, these templates were designed to be flexible. You can take these templates, modify or swap out the source code, and get up and running on Azure in just a couple of minutes. Each of these templates includes Infrastructure as Code files that specify and configure all the Azure resources needed for your application to run in the cloud.<\/p>\n<h3>Dapr<\/h3>\n<p>If you&#8217;re unfamiliar, <a href=\"https:\/\/dapr.io\/\">Dapr<\/a> (also known as Distributed Application Runtime) provides APIs that simplify microservice connectivity. There are nine samples built for JavaScript, C# and Python applications that you can find <a href=\"https:\/\/github.com\/Azure-Samples?q=dapr+azd-templates&amp;type=all&amp;language=&amp;sort=\">here<\/a>.<\/p>\n<p>These samples cover common patterns like:<\/p>\n<ul>\n<li>Pub\/sub<\/li>\n<li>Working with external systems as inputs and outputs, and<\/li>\n<li>Communicating reliably and securely via auto-mTLS and built-in retries<\/li>\n<\/ul>\n<h3>Python<\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/Azure-Samples\/msdocs-flask-postgresql-sample-app\">Deploy a Python (Flask) web app with PostgreSQL in Azure<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Azure-Samples\/msdocs-django-postgresql-sample-app\">Deploy a Python (Django) web app with PostgreSQL in Azure<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pamelafox\/fastapi-azure-function-apim\">HTTP API powered by FastAPI with Azure Functions and APIM<\/a><\/li>\n<\/ul>\n<h3>JavaScript<\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/Azure-Samples\/app-service-javascript-sap-cloud-sdk-quickstart\">Application using SAP Cloud SDK for OData consumption from SAP S4 with Azure App Service<\/a><\/li>\n<\/ul>\n<h3>Java<\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/Azure-Samples\/spring-petclinic-java-mysql\">Spring Boot application on Azure App Service with Azure Database for MySQL<\/a><\/li>\n<\/ul>\n<h2>Other changes and enhancements<\/h2>\n<p>We have also added small enhancements and fixed issues requested by users that should improve your experience working with the Azure Developer CLI. Some notable changes include:<\/p>\n<ul>\n<li>Fix <code>azd up --template<\/code> so it can initialize a new project <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1394\">(azure-dev#1394)<\/a><\/li>\n<li>MSI Upgrades from pre-MSI versions fail in some cases <a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\/1406\">(azure-dev#1406)<\/a><\/li>\n<li>Improve UX styling for <code>azd pipeline config<\/code> <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1407\">[azure-dev#1407]<\/a><\/li>\n<li><code>init<\/code> now restores file executable permissions and initializes a <code>git<\/code> repository automatically. <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1495\">(azure-dev#1495)<\/a><\/li>\n<li>Improve performance of <code>azd --help<\/code> on Windows for domain-joined users <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1470\">(azure-dev#1470)<\/a><\/li>\n<li>Fix display for Function App types in <code>provision<\/code> progress <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1503\">(azure-dev#1503)<\/a><\/li>\n<\/ul>\n<h2>Community contributions<\/h2>\n<p>We\u2019d also like to extend a special thanks to the community contributors of this release:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/flcdrg\">flcdrg<\/a> &#8211; for their work on creating our Chocolatey package<\/li>\n<li><a href=\"https:\/\/github.com\/aaronpowell\">aaronpowell<\/a> &#8211; Incorrect message on <code>azd login --help<\/code> <a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\/1360\">(azure-dev#1360)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pamelafox\">pamelafox<\/a>\n<ul>\n<li>Add err to message for help with debugging login issue <a href=\"https:\/\/github.com\/Azure\/azure-dev\/issues\/1365\">(azure-dev#1365)<\/a><\/li>\n<li>Core bicep module <code>apim-api.bicep<\/code> now links Web App or Function App instances to allow users on the Azure portal to navigate to the API management resource directly from the Web App or Function App.<a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1403\">(azure-dev#1403)<\/a><\/li>\n<li>Core bicep module <code>appservice.bicep<\/code> now supports <code>ftpsState<\/code> as a parameter to configure FTPS upload behavior <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1345\">(azure-dev#1345)<\/a><\/li>\n<li>Display <code>provision<\/code> progress for PostgreSQL server resources<a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1418\">(azure-dev#1418)<\/a><\/li>\n<li>For Python projects, skip packaging of virtual environment (<code>.venv<\/code> folders) <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1483\">(azure-dev#1483)<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/github.com\/lechnerc77\">lechnerc77<\/a> &#8211; Core bicep module <code>appservice.bicep<\/code> now supports <code>healthCheckPath<\/code> as a parameter to configure the health-check endpoint <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/1497\">(azure-dev#1497)<\/a><\/li>\n<\/ul>\n<p>Try out these new improvements by <a href=\"https:\/\/aka.ms\/azure-dev\/install-instructions\">installing the Azure Developer CLI<\/a>!<\/p>\n<p>You can use the Azure Developer CLI from:<\/p>\n<ul>\n<li>Your terminal of choice on Windows, Linux, or macOS.<\/li>\n<li>Visual Studio Code or GitHub Codespaces by <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-azuretools.azure-dev\">downloading the extension<\/a> from the Marketplace, or installing it directly from the extension view (<code>Ctrl<\/code> + <code>Shift<\/code> + <code>X<\/code>, or <code>Cmd<\/code> + <code>Shift<\/code> + <code>X<\/code> for macOS) in Visual Studio Code.<\/li>\n<li>Visual Studio by <a href=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/introducing-the-azure-developer-cli-a-faster-way-to-build-apps-for-the-cloud\/#visual-studio\">enabling the preview feature flag<\/a>.\nYou can learn more about the Azure Developer CLI from our <a href=\"https:\/\/aka.ms\/azd\">Dev Hub documentation<\/a>. If you run into any problems or have suggestions, file an issue or start a discussion on <a href=\"https:\/\/github.com\/Azure\/azure-dev\">Azure Developer CLI repo<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This post announces the February 2023 release of the Azure Developer CLI (`azd`).<\/p>\n","protected":false},"author":95415,"featured_media":2276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[864,878,160,159,162,733],"class_list":["post-2433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-azure-developer-cli","tag-codespaces","tag-java","tag-javascript","tag-python","tag-typescript"],"acf":[],"blog_post_summary":"<p>This post announces the February 2023 release of the Azure Developer CLI (`azd`).<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/2433","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=2433"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/2433\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/2276"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=2433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=2433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=2433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}