Skip to content

antonidag/github-action-bicep-what-if-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Action Bicep what-if deployment

Description

Project files for building, validating and preforming what-if deployment.

See my full blog post here!

Installation

Let's gather our tools:

  • Az CLI 🧙
  • Az Bicep extension
az bicep install

Usage

Step 1: Login to Azure

az login

This will prompt a new window in your browser and allow you to log in to your account.

Step 2: Set the subscription

az account set --subscription {SUBSCRIPTION_ID} 

Step 3: Build Bicep template

az bicep build --file main.bicep

Step 4: Validate the deployment

az deployment group validate 
--resource-group {RESOURCE_GROUP} 
--name ValidateDeployment  
--template-file main.bicep 
--parameters main.bicepparam

Step 5: Perform a What-if deployment

az deployment group what-if 
--resource-group {RESOURCE_GROUP} 
--name WhatIfDeployment 
--template-file main.bicep 
--parameters main.bicepparam