Automating Azure Deployments (Infrastructure as Code) – Part 1

Once you’ve deployed resources in Azure Portal for a while, it doesn’t take long until you start getting sick of going through pages and pages of options. If you have a keen eye, you may have noticed the Download a template for automation link once you’ve reached the Review + create step.

Click the link and you’ll be greeted with a wall of JSON, which is the format used by ARM (Azure Resource Manager) templates. Much like how selections in Windows Servers Manager ultimately boil down to a PowerShell command for final execution, selections in Azure Portal ultimately boil down to an ARM template for deployment.

So, if you’re trying to deploy something in Azure over and over again, you can just download the template and insert appropriate parameters, right?

Well, in theory, yes. But have you SEEN an ARM template? If you’re an old-school point-and-clicker like me, you would immediately close VS Code and go back to taking screenshots of your deployment process.

But wait, don’t give up yet.

Microsoft acknowledged the ugliness of JSON based deployment and responded with yet another programming language called Bicep (Get it? Deploy ARM templates with Bicep?). As reluctant as I am to learn yet another programming language when I’m already mediocre at half-dozen others, I think this whimsically named language is worth a look.

The following YouTube video by Casey Mullineaux does a great job of explaining why. It’s within the context of deploying Sentinel, but the same concept applies to any other Azure resource you wish to deploy (start at 5:23):

Before we go on

I’m currently going through the Microsoft Learn Bicep module, and I have to say it’s excellent: https://docs.microsoft.com/en-us/learn/paths/fundamentals-bicep/

"Fundamentals of Bicep" Microsoft Learn module

If your goal is to easily deploy one or two resources quickly, you could always run PowerShell commands. Copy-and-pasting commands is faster and more accurate than clicking through pages of web forms. Microsoft calls this imperative code, which is to say, you tell Azure how to deploy resources step-by-step.

This is in contrast with declarative code, which describes what the finished deployment looks like, and Azure figures out how to get there. This is how Bicep works, and it really starts to flex when combined with Azure Pipelines.  https://docs.microsoft.com/en-us/learn/paths/bicep-azure-pipelines/

Using Azure Pipelines allow you to deploy a template across multiple clients once, then make modifications once when needed. If you relied on PowerShell, you’d have to log in to each client to run the new code one-by-one. Having said that, if you just need to deploy something quick and dirty, PowerShell is the way to go.

Wrapping up

I plan to make more posts on this topic once I finish the Microsoft Learn Bicep module. There’s certainly a lot to learn but the potential payoff is HUGE. Get ready to flex some muscles.

For best results, install the latest PowerShell as well as the AZ module

Installing latest PowerShell
https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2#msi

Installing Azure Az Powershell module
https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-7.0.0

Installing Bicep
winget install -e –id Microsoft.Bicep

Zeph aniahZeph aniah
18:24 11 Dec 24
He was very patient on addressing the issues I had with my old laptop.
Stuart JacksonStuart Jackson
18:50 10 Dec 24
Mikaela Maya-BaezMikaela Maya-Baez
16:18 19 Nov 24
Zeph aniahZeph aniah
00:23 14 Nov 24
Debbie LamarDebbie Lamar
23:41 30 Oct 24
Jun AlarconJun Alarcon
15:11 29 Oct 24
great prompt accommodation, solved the problem right away
Yvonne TejedaYvonne Tejeda
21:57 21 Oct 24
Keenan was very helpful, knowledgeable and patient! He helped me resolve my issue promptly and efficiently.
David K.David K.
19:14 17 Oct 24
Relion is a great It service if you have a company that needs IT support. I had Kat assisting me today with my work laptop, and she was fast and very professional. I highly recommend Relion if you or your company is looking for great IT support.
Shwetha SunilShwetha Sunil
20:59 16 Sep 24
eren fernandezeren fernandez
18:58 10 Sep 24
Excellent Customer Service.
Jennifer JohnstonJennifer Johnston
18:46 10 Sep 24
Michelle McGinnisMichelle McGinnis
20:04 22 Aug 24
Brian was awesome, as usual. Highly recommended!!
Grace AttwaterGrace Attwater
21:25 20 Aug 24
We’ve been with Relion for quite a few years. They are professional, knowledgeable and prompt. We highly recommend using Relion for all your IT needs.
Wayne Lee (LEWAYHUN)Wayne Lee (LEWAYHUN)
20:24 21 Jun 24
Relion & their team has always been great about responding quickly, even on wkends.Friendly & knowledgeable, we frequently invite them to our Co events as they are so integrated into our Co as experts in their field.
Todd CTodd C
18:56 07 May 24
Hi all, This IT support company knows what they are doing.I was in IT support for many years, and I can tell you these guys know their stuff.They are friendly and never make you feel bad for your level of knowledge.Manny was able to get me set up and going.We had lots of challenges as my PC was not set up right by others. He found the right resources to get me all fixed in 1 Call.I will call back and ask for Manny again.Have a great day all.Rember to update your OS and Anti-Virus programs each week
Katherine TwomeyKatherine Twomey
21:43 01 May 24
Relion is an amazing IT company! They are super quick to answer both phone and email inquiries, they are kind, courteous, and knowledgeable! All of the techs are amazing, but I have dealt with Zach the most, and he is a pleasure to do business with!
Jacklyn WaltersJacklyn Walters
22:29 19 Apr 24
The Relion team is the best! No matter the problem, big or small or as simple as restarting your computer, they will help you solve it. I've worked directly with each member of the team and every one of them is a delight. They are patient, kind, and really know their stuff. After nearly three years working with them, I highly recommend Relion for all of your IT needs.Update: Two months since leaving my initial review, I have worked with Manny countless times on everything from setting up new devices to adding employee access to our company drives. He is always a pleasure to work with and solves any problems quickly and efficiently. Thanks Manny! (And the entire Relion team!)
David WalkerDavid Walker
22:26 08 Feb 24
Relion has been amazing! They have saved us from protential problems, helped us convert our entire network, phone lines, and mobile apps flawlessly. I have worked with them for at least 10 years now and would not have grown our our company with out them. Relion has helped us grow from 15 to 700 plus people.They have reduce our stress and allowed us to understand and grow with the constant changes in IT environment. They are one of our best partners in our business! Their entire team cares and are easy to work with.Dave WalkerWalker Brothers Machinery moving.
js_loader

BUSINESS

STARTING AT $1,000 PER MONTH

NON-PROFIT

STARTING AT $750 PER MONTH

New client consultation

Scroll to Top