If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.
This add-on installs the Azure CLI (az) and its Azure DevOps extension in the DDEV web container, and authenticates it with an Azure DevOps personal access token (PAT).
It adds two commands:
ddev az runs az with any arguments.ddev az-login sets your default organization and project, and checks that the PAT works.ddev add-on get yanniboi/ddev-az-cli
ddev restart
After installation, make sure to commit the .ddev directory to version control.
ddev add-on get creates .ddev/.env.web.az-cli.local with commented-out placeholders. Open it in an editor, uncomment AZURE_DEVOPS_EXT_PAT and paste your token. DDEV loads the file into the web container, and its generated .gitignore keeps .local files out of version control. Reinstalling the add-on keeps an existing file.
AZURE_DEVOPS_EXT_PAT=your-token
Restart DDEV and set your default organization (and, optionally, project):
ddev restart
ddev az-login https://dev.azure.com/my-org MyProject
ddev az-login my-org works too. You can also uncomment AZURE_DEVOPS_ORG and AZURE_DEVOPS_PROJECT in the same env file and run ddev az-login with no arguments.
The Azure DevOps extension reads AZURE_DEVOPS_EXT_PAT on every command, so nothing else is stored and the token also reaches agent sandboxes and scripts that can’t answer a prompt.
If AZURE_DEVOPS_EXT_PAT isn’t set, ddev az-login asks for the PAT without echoing it and runs az devops login. The container has no system keyring, so az stores the PAT in plain text in .ddev/azure/azuredevops/personalAccessTokens. Remove it with ddev az devops logout.
ddev az devops project list
ddev az repos pr list --status active
ddev az boards work-item show --id 1234
ddev az pipelines runs list --top 5
az is also on PATH inside ddev ssh and ddev exec.
Azure resource commands (az group list and the like) need az login rather than a DevOps PAT. Use ddev az login --use-device-code, since the container has no browser.
The add-on sets AZURE_CONFIG_DIR to .ddev/azure, so the default organization, any stored login and other az config survive ddev restart and ddev debug rebuild. No other DDEV project can read it, but anything with access to your project directory can.
.ddev/azure/.gitignore ignores everything in that directory except itself. Commit it with the rest of .ddev, so teammates who clone the project get the same rule. ddev add-on remove az-cli deletes the directory and everything stored in it.
| File | Purpose |
|---|---|
.ddev/web-build/Dockerfile.az-cli |
Installs azure-cli from Microsoft’s apt repository, plus the azure-devops extension in /opt/az-cli/extensions |
.ddev/commands/web/az |
The ddev az command |
.ddev/commands/web/az-login |
The ddev az-login command |
.ddev/docker-compose.az-cli.yaml |
Sets AZURE_CONFIG_DIR and AZURE_EXTENSION_DIR, and turns off telemetry |
.ddev/azure/.gitignore |
Keeps the stored config and any PAT out of version control |
.ddev/.env.web.az-cli.local |
Created once with placeholders for the PAT and default organization and project. Not overwritten or removed by the add-on |
Microsoft doesn’t publish an azure-cli package for every Debian release. When there is none for the web image’s release (Debian trixie at the time of writing), the build uses the bookworm package, as Microsoft’s own install script does.
DDEV caches the web image, so az stays at the version it was built with. Run ddev debug rebuild to pick up a new release. az upgrade won’t work in the container.
ddev add-on remove az-cli
ddev restart
Commits follow Conventional Commits, checked by commitlint in a husky commit-msg hook. Run npm install once to enable the hook.
Releases are automatic. After the tests workflow passes on main, semantic-release reads the commits since the last tag. A feat: commit makes a minor release, a fix: or perf: commit makes a patch release, and a BREAKING CHANGE: footer makes a major one. Other types do not release.
Contributed and maintained by @yanniboi
If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.