Showing items from Azure

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

Building a Hugo Site and Deploying to Linux using Azure DevOps

Summary (tl;dr)

Building a Hugo site using Azure DevOps and deploying to a Linux server is done by:

  1. Set up an SSH service connection in Azure DevOps
  2. Create a pipeline in Azure DevOps. The pipeline will need several steps:
    1. Install Hugo
    2. Build the site
    3. Deploy the built site

Setting up an SSH Service Connection in Azure DevOps

An SSH service connection is what will allow your hosted Azure DevOps agent to connect to your Linux based server using SSH. Service connections can be found under the Project Settings, on the bottom left side of the UI:

Continue Reading