Run scripts with azd environment context
Database migrations, setup automation, CI/CD workflows — with seamless access to Azure credentials and Key Vault secrets.
Security Notice
IMPORTANT: azd exec executes scripts with full access to your Azure credentials and environment.
Only run scripts you trust and have reviewed. Never pipe untrusted scripts from the internet.
Features
Multiple Shell Support
Automatically detects and runs bash, sh, zsh, PowerShell, pwsh, and cmd scripts based on file extension or shebang.
Script Arguments
Pass arguments to your scripts seamlessly with the -- separator for clean parameter handling.
Full Azure Context
Access all azd environment variables including subscription, tenant, location, and custom variables.
Working Directory Control
Execute scripts from any directory with the global --cwd flag for flexible automation.
Interactive Mode
Run scripts with interactive input support for prompts and user interaction.
Azure Key Vault Integration
Automatically resolves Key Vault references in environment variables, securely fetching secrets at runtime without hardcoding credentials.
Battle-Tested
Comprehensive security scanning with CodeQL and gosec (0 vulnerabilities). 86%+ test coverage.
Quick Start
Install Extension
# Install Azure Developer CLI
winget install microsoft.azd
# Add extension source
azd extension source add -n jongio -t url -l https://jongio.github.io/azd-extensions/registry.json
# Install extension
azd extension install jongio.azd.exec # Install Azure Developer CLI
brew tap azure/azd && brew install azd
# Add extension source
azd extension source add -n jongio -t url -l https://jongio.github.io/azd-extensions/registry.json
# Install extension
azd extension install jongio.azd.exec # Install Azure Developer CLI
curl -fsSL https://aka.ms/install-azd.sh | bash
# Add extension source
azd extension source add -n jongio -t url -l https://jongio.github.io/azd-extensions/registry.json
# Install extension
azd extension install jongio.azd.exec Verify Installation
azd exec versionRun Your Script
# Review the script firstcat ./run-migration.sh
# Then executeazd exec ./run-migration.shExample Scripts
Bash Script
#!/bin/bashecho "Running database migration for: $AZURE_ENV_NAME"
# Get database connection string from Azure SQLCONN_STRING=$(az sql db show-connection-string \ --server "sql-$AZURE_ENV_NAME" \ --name "db-$AZURE_ENV_NAME" \ --client sqlcmd -o tsv)
# Run migration using sqlcmd or your migration toolsqlcmd -S "sql-$AZURE_ENV_NAME.database.windows.net" \ -d "db-$AZURE_ENV_NAME" \ -G -i ./migrations/001_add_users_table.sql
echo "Migration completed!"PowerShell Script
Write-Host "Environment: $env:AZURE_ENV_NAME"Write-Host "Resource Group: $env:AZURE_RESOURCE_GROUP"
# Your setup logic hereReady to get started?
Install azd exec and start running your scripts with Azure context.
Get Started Now