Jump to content

Recommended Posts

Posted (edited)
I've recently started looking at custom Powershell scripts to manage Azure/365; eg I'm currently looking at a script to report users without MFA enabled. ChatGPT is helpful for this kind of stuff, and it's very powerful, but also slightly terrifying running Powershell scripts on our live system, wherever they've come from. I was wondering if anyone had set up an Azure test environment for this kind of thing, and how to do it...? Edited by BJG
Posted

Several - you can free a free developer tenant with a decent amount of functionality and licenses. I also have a separate paid tenant with a £5 a month license and making use of teams exploratory. Various dns domains associated to both.

 

Reasonably beefy PC with good few VMs with various flavours of AD and Exchange and Azure AD connection sat in my companies dev space (my garage). All just sandpit stuff.

 

The gold standard would be a preprod tenant, defined by code, which you run through all config first and then point the code at prod, so you are in sync.

  • Thanks 1
Posted (edited)

The way I did powershell scripts was to think of what I wanted to do, break it down to individual steps and thn research on the Internet how to perform those steps. It wasn't very efficient but I did not want to run random scripts from the Internet without knowing exactly what they were doing at each command.

 

These days I jus look back at old scripts if I think I might of needed to do something. If the syntax changes should be able to update the command or a small section of the whole script to compensate.

 

But yes you could jus spin up a new tenant and practice against that for basic scripts?

Edited by Davit2005
Posted

The way we do this (in GCP/Workspace) - but exactly the same principal applies to Azure, (I used to have to do this for Azure):

 

Build out the azure tenant as IasC, to protect from any manual changes, configuration drift and so you can automate changes

Rebuild the production environment to a new tenant, replacing environment variable specific to production with you testing vars.

test the application

Tear down the test environments

You can use your favourite CI/CD system so this is all automated.

 

We currently have this entire process automated. The system is:

Engineer writes some code and commits the change to github. Github sends a hook to Ci/CD (Jenkins). Jenkins runs tests and linters against the code. If these pass it builds a new environment and tests the code actually works. When the engineers has approval and the github code is puhed to the main branch, another hook is sent and the code is automatically applied to the production system.

 

or just test it live YOLO :)

Posted
I've recently started looking at custom Powershell scripts to manage Azure/365; eg I'm currently looking at a script to report users without MFA enabled. ChatGPT is helpful for this kind of stuff, and it's very powerful, but also slightly terrifying running Powershell scripts on our live system, wherever they've come from. I was wondering if anyone had set up an Azure test environment for this kind of thing, and how to do it...?

 

you can setup a dev tenant here: https://developer.microsoft.com/en-us/microsoft-365/dev-program

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...