Showing items from Bicep

Useful Commands When Working with Bicep in Azure

Here are some useful commands when working with Bicep in Azure. Here I mostly focus on commands for when things go wrong or you need to troubleshoot deployments.

Working with subscription deployments

# List all subscription deployments
az deployment sub list

# Show only the names of subscription deployments
az deployment sub list --query "[].name" -o tsv

# Show details of a specific subscription deployment
az deployment sub show --name <deployment-name>

# Delete a specific subscription deployment
az deployment sub delete --name <deployment-name>

# Delete all subscription deployments using PowerShell
az deployment sub list | ConvertFrom-Json | ForEach-Object {az deployment sub delete --name $_.name}

# Delete all subscription deployments using bash
az deployment sub list --query "[].name" -o tsv | xargs -I{} az deployment sub delete --name {}

That takes care of subscription deployments. Likely you will have resource group deployments as well. Next, let’s look at resource group deployments.

Continue Reading