About Me

My photo
Bergen, Norway
19th times Microsoft MVP (Security and Windows). IT-Dude @SpareBankenNorge

Friday, April 17, 2020

Creating Azure Resource Groups with PowerShell

I am working in a intense DevOps environment so I am creating new Resource Groups in Azure quite often. Doing this the manual way are of course are quite boring and might open up for different types of mistakes. 


So way not make sure that the mistakes are consistent and do it with a script?
I have made the script with an example input file available on my GitHub so you can find it here:

https://github.com/OTvedt/Scripts-For-Sharing/tree/master/Azure/ResourceGroup/Create-ResourceGroup

It is based on information from https://docs.microsoft.com/en-us/azure/role-based-access-control/tutorial-role-assignments-user-powershell

And it should be easy to adjust it to your own needs. I am adding "Contributor" and "Reader" and adding two tags too each RG.

I am also always using the same region so I don't have that as in input in the input file, but it is an variable in the script it self. Should be easy to add this to the input file if you need too.

Fix Windows Sandbox network issues by setting a custom DNS server

Windows Sandbox is one of the easiest ways to test files, scripts, applications, and troubleshooting steps in a clean, temporary Windows env...