Accessing deployment outputs for later use
It is worth mentioning again that you will face scenarios where you need to access your deployment output for many reasons, such as using it in the same pipeline in a later step, accessing it from another pipeline, or simply using it to find out about a property of a resource after it has been deployed for monitoring.
Accessing outputs from the Azure CLI action
If you are using the Azure CLI action, you can use the same approach we used in Chapter 10, Deploying Bicep Using Azure DevOps:
echo "BLOB_URL=$(az deployment group show -g ${{ secrets.RG_NAME }} -n BicepDeployment --query properties.outputs.blobURL.value -o tsv)" >> $GITHUB_ENV
This will create an environment variable called BLOB_URL
, which you can access later using the regular GitHub syntax:
echo "${{ env.BLOB_URL }}"
Your complete step should look like this:
on: [push] name: Deploy Bicep template jobs: build-and-deploy...