tomasrudh / AutoShutdownSchedule

Script intended as Azure automation runbook that automatically starts and stops virtual machines according to tags.
MIT License
18 stars 10 forks source link

Add different Azure Environments capability #13

Closed hymccord closed 2 years ago

hymccord commented 2 years ago

This will resolve #12

I can also revert the last commit with the TOC change if needed. Just let me know!

hymccord commented 2 years ago

Output log from it successfully running in our cloud

Mode             : Process

ContextDirectory : 

ContextFile      : 

CacheDirectory   : 

CacheFile        : 

Settings         : {}

Runbook started. Version: 3.9.0

*** Running in LIVE mode. Schedules will be enforced. ***

Current Eastern Standard Time time [Thursday, 2022 Mar 17 15:01:44] will be checked against schedules

Specified subscription name/ID: [SUBSCRIPTION_NAME]

Specified Azure Environment: [AzureUSGovernment]

Logging in to Azure using the system managed identity...

Working against subscription: <SUBSCRIPTION_NAME> (<GUID>)

Found [0] schedule-tagged resource groups in subscription

Processing [0] virtual machines found in subscription

Finished processing virtual machine schedules

Runbook finished (Duration: 00:00:15)
tomasrudh commented 2 years ago

Hello, thank you so much for your contribution, and sorry for my late reply.

I will tweak your code just a little, but definitely implement it. And also your changes to the TOC.

Thanks again! /Tomas

hymccord commented 2 years ago

Fixed some whitespace issues I didn't see. I originally made the changes inside the module editor in our automation account and didn't realize it inserted tabs instead of spaces. Trimmed off trailing whitespace as well.