This is part of my series on learning to build an End-to-End Analytics Platform project.
TLDR; After I refactored my code to use modules I found that Bicep supports ‘What-If’ operations which explain what the code is going to do before deploying it. This post I do a short test on that. Found an issue not showing Azure Synapse resource creation. Then browsed the Bicep GitHub repo to search issues related to What-If operations. Didn’t find what I was hoping for, so logged my first public GitHub issue 😁.
Update: The issue we encountered seems to be related to another preflight improvement which is being worked on but is a “…bit of a gnarly, low level issue so please be patient 🙂“. I was amazed to see how quickly Bicep the team responded on this.
What happens when I push this button? 🤔
az deployment sub create --name '<name of deployment>' --location '<location name>' --template-file '<path to bicep file>' --confirm-with-what-if
Side note: I had to change the VS Code theme to save us all from the agony of lime green on light grey background reading.
What’s nice is we get a breakdown of changes that we are about to apply to our environment. I think that is awesome.
Yes, for the eagle-eyed reader, I realised my storage account name is an Azure Region name hahaha 😂
Looking at the terminal output, reading top to bottom, I can see:
- We are about to deploy at the subscription scope.
- We are deploying a Azure Data Lake Gen2 Storage Account with blob container and all their configuration goodness.
- We are deploying an Azure Synapse… wait a minute…
What was weird was that I didn’t see the Synapse Workspace. I checked the deployment details/output and it was there.
I wondered if the reason it didn’t output the Azure Synapse Resource during the What-If was because I didn’t define any output variables for it which I did for the storage account.
I updated my variables, added output variables for my synapse.bicep module, then ran the What-If again. Aaaaand…. nothing changed. Considering Bicep is an Open Source project on GitHub we get to search for issues with ‘What-If’ operations. So, we get to create a issue 😁 Taking the things learnt over the past few posts on
That’s it. Done. Created our first public issue: what-if operation doesn’t seem to include all bicep defined or created resources · Issue #3682 · Azure/bicep (github.com).
The what-if behaviour doesn’t block us at this stage. The deployment works so at this point I think we are set for the next section to work on getting this into a GitHub Actions pipeline.