Giving Azure VM’s Environmental Variables through ARM templates.

My Problem

I’m building a one-click deployment arm template for UiPath’s Orchestrator. As part of this I’m trying to pass connection information into my VM through the environmental variables. I’ve only found a way to pass one environment variable in at a time. The example found here falls apart as soon as you start running multiple commands

My Solution

This solution doesn’t meet my expectations but my hand is being forced unless I can find a better way. Since I’ve got a reliable way to get one string value into my environment, I’ve taken to cramming everything I need into that one variable and parsing it out. It’s working for now, but for my use-case I really only need 3 values. If my requirements were any larger I’d be wrestling with a real beast.

More Info

I’m running into this problem because as part of the installation of UiPath’s Orchestrator, I need to connect it with a database. I’ve opted to use the azure sql server and need to use values that are determined during deployment. It seems to me that the Custom Script Extension is just what I need, minus this shortfall. This is all being done so that within my organization whenever someone needs an instance of Orchestrator we’ve got everything set up and ready to go. Right now it’s ~10 minutes from the start of the deployment to having a working instance. Hopefully shorter if I can transition from having to remote into the server and run a script to that script being run automatically.

The Hunt for Auto-Shutdown of Azure Government Cloud Virtual Machines

I’ve spent the last week hunting for a way to shutdown and start vms in azure. My first idea was to create a site that could be used by people on my team to start and stop the vms as needed. Following that line of logic I eventually found this site. It describes the government cloud endpoints by listing the public endpoints alongside them. Fortunately, I found this while writing this post; after I found the solution I ultimately went with. By not finding that mapping of endpoints I was forced to scour further for the answer to my problem. That solution lies here. With this I was able to quickly set up an automation that did most of what I wanted (the shutting down of the vms off hours) and it helped me realize that I didn’t need to worry about doing everything I had originally intended. There was never a need to go to a website to start up the vms as the entire team already has access. Turns out the better solution to my problem meant that I didn’t have to write any code, contrary to my development focused mind.