We’re pleased to announce that the February 2023 release (0.6.0-beta.1
) of the Azure Developer CLI (azd
) is now available. You can learn about how to get started with the Azure Developer CLI by visiting our Dev Hub.
This release includes the following features and improvements:
- Support for command and service hooks (azure-dev#1429)
- Support for installation via Homebrew, Windows Package Manager, and Chocolatey (azure-dev#1383, azure-dev#1382, azure-dev#744)
- Support for multiple Azure organizations (azure-dev#1478)
- New Templates – Dapr, Python, JavaScript and Java!
If you’re interested, we’re also hosting a community standup on February 16 at 11:00am PT on the Azure Developers YouTube and Twitch channels. Hope to see you all there!
Support for command and service hooks
We’re excited to announce that as of this release you’re now able to even further customize your workflow via new command and service hooks. In chatting with our users, we’d heard feedback that sometimes you want to execute some task or script pre- or post- azd
command or service event. With this feedback in mind, we’ve added the ability for you to execute scripts or commands from within your project’s azure.yaml
.
Available hooks
The following azd
command hooks are now available:
prerestore
andpostrestore
: Run before and after package dependencies are restored.preprovision
andpostprovision
: Run before and after Azure resources are created.predeploy
andpostdeploy
: Run before and after the application code is deployed to Azure.preup
andpostup
: Run before and after the combined deployment pipeline.Up
is a shorthand command that runsrestore
,provision
, anddeploy
sequentially.predown
andpostdown
: Run before and after the resources are removed.
The following service lifecycle event hooks are available:
prerestore
andpostrestore
: Run before and after the service packages and dependencies are restored.prepackage
andpostpackage
: Run before and after the app is packaged for deployment.predeploy
andpostdeploy
: Run before and after the service code is deployed to Azure.
Here’s an example of how to configure both an inline script on pre-restore
and an external script on pre-provision
using this new feature:
name: todo-nodejs-mongo
metadata:
template: todo-nodejs-mongo@0.0.1-beta
hooks:
prerestore: # Example of an inline script. (shell is required for inline scripts)
shell: sh
run: echo 'Hello'
preprovision: # Example of external script (Relative path from project root)
run: ./hooks/preprovision.sh
services:
web:
project: ./src/web
dist: build
language: js
host: appservice
api:
project: ./src/api
language: js
host: appservice
To learn more about our new hooks support and see examples, check out this article on our DevHub.
Support for installation via Homebrew, Windows Package Manager and Chocolatey
We’ve been teasing support for installing azd
via your favorite package managers for a couple releases now so we’re excited to announce we’re shipping support for Homebrew (brew
), Windows Package Manager (winget
), and Chocolatey (choco
) in the latest release of the CLI.
You can now install azd
via:
brew tap azure/azd && brew install azd
winget install microsoft.azd
choco install azd
If your favorite package manager isn’t yet supported, you can continue to follow the instructions at aka.ms/azd-install. We’re also working on supporting installation via apt
and yum
so stay tuned for that support in an upcoming release.
Support for multiple Azure organizations
Subscriptions from all organizations of the user are now listed when azd init
prompts for subscriptions.
All azd
commands also support running against environments from different organizations seamlessly. Previous workarounds that required auth.useAzCliAuth
set to true
should no longer be required. If you use subscriptions from multiple Azure organizations and have feedback on this new experience, let us know!
New Templates – Dapr, Python, JavaScript and Java!
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.
Dapr
If you’re unfamiliar, Dapr (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 here.
These samples cover common patterns like:
- Pub/sub
- Working with external systems as inputs and outputs, and
- Communicating reliably and securely via auto-mTLS and built-in retries
Python
- Deploy a Python (Flask) web app with PostgreSQL in Azure
- Deploy a Python (Django) web app with PostgreSQL in Azure
- HTTP API powered by FastAPI with Azure Functions and APIM
JavaScript
Java
Other changes and enhancements
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:
- Fix
azd up --template
so it can initialize a new project (azure-dev#1394) - MSI Upgrades from pre-MSI versions fail in some cases (azure-dev#1406)
- Improve UX styling for
azd pipeline config
[azure-dev#1407] init
now restores file executable permissions and initializes agit
repository automatically. (azure-dev#1495)- Improve performance of
azd --help
on Windows for domain-joined users (azure-dev#1470) - Fix display for Function App types in
provision
progress (azure-dev#1503)
Community contributions
We’d also like to extend a special thanks to the community contributors of this release:
- flcdrg – for their work on creating our Chocolatey package
- aaronpowell – Incorrect message on
azd login --help
(azure-dev#1360) - pamelafox
- Add err to message for help with debugging login issue (azure-dev#1365)
- Core bicep module
apim-api.bicep
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.(azure-dev#1403) - Core bicep module
appservice.bicep
now supportsftpsState
as a parameter to configure FTPS upload behavior (azure-dev#1345) - Display
provision
progress for PostgreSQL server resources(azure-dev#1418) - For Python projects, skip packaging of virtual environment (
.venv
folders) (azure-dev#1483)
- lechnerc77 – Core bicep module
appservice.bicep
now supportshealthCheckPath
as a parameter to configure the health-check endpoint (azure-dev#1497)
Try out these new improvements by installing the Azure Developer CLI!
You can use the Azure Developer CLI from:
- Your terminal of choice on Windows, Linux, or macOS.
- Visual Studio Code or GitHub Codespaces by downloading the extension from the Marketplace, or installing it directly from the extension view (
Ctrl
+Shift
+X
, orCmd
+Shift
+X
for macOS) in Visual Studio Code. - Visual Studio by enabling the preview feature flag. You can learn more about the Azure Developer CLI from our Dev Hub documentation. If you run into any problems or have suggestions, file an issue or start a discussion on Azure Developer CLI repo.
0 comments