IT professional in Austin, Texas.

  • 2 Posts
  • 1 Comment
Joined 1 year ago
cake
Cake day: June 17th, 2023

help-circle
  • Makes sense. I found an environment variable that detects whether the process is running in Azure Automation, i.e. it’s running in Azure Automation if the variable is defined:

    Get-ChildItem -Path env:AZUREPS_HOST_ENVIRONMENT
    

    This helped me provide some conditional control on when to use the managed identity and when to use my interactive credentials.

    All the while I’m figuring out that using the Azure Automation plugin with VS Code is only useful for publishing code in runbooks; the extension doesn’t provide an easy way to manage custom modules. And with the code I’m writing, I’m quickly finding that it won’t be efficient to include everything in runbook files. So I’m now heading down the path of using a pipeline to publish my custom module to Azure Automation, then calling that module with a lightweight runbook.

    Appreciate the guidance!