How to create a maintenance mode in Azure Automation

An emergency button to ensure that your runbooks stop running without disconnecting the schedule in Azure Automation Disclaimer: This post can be seen as satire. There are probably better ways, but because we were so limited with the customer at the time, we opted for a hobby approach: ‘Maintenance mode the creative way‘. What if… … Continue reading How to create a maintenance mode in Azure Automation

How to import PowerShell 7 runbooks in Azure Automation

Import a PowerShell 7.XX runbook in Azure Automation via PowerShell You cannot currently choose PowerShell 7.XX runtime via the standard cmdlet New-AzAutomationRunbook in the Az.Automation module. This limits you to using the Azure portal. You can upload runbooks via a workaround with runtime 7.XX. This only applies to powershell script files located in an Azure … Continue reading How to import PowerShell 7 runbooks in Azure Automation

FIX: Azure Automation PS 7 not recognizing environment variables

Do I run the script (runbook) locally or in Azure Automation? I develop scripts or runbooks on my local machine and then run them against Microsoft Graph or Azure (REST API) and when the script is complete I upload them in Azure Automation as a runbook. I need logic in my script to see if … Continue reading FIX: Azure Automation PS 7 not recognizing environment variables

FIX: Import-Module Az.Accounts in Azure Automation sandbox

FIX: The term ‘AZ.ACCOUNTS CMDLET‘ is not recognized as a name of a cmdlet, function, script file, or executable program I’m getting several errors in an Azure Automation runbook job, all of which amount to the same thing. I made a seperate error messages section, because it’s too much for the intro section! But the … Continue reading FIX: Import-Module Az.Accounts in Azure Automation sandbox

FIX: Please remove the lock and try again ScopeLocked Azure

‘The scope cannot perform delete operation because following scope(s) are locked‘ The tutorial works for all Azure resources that have a lock. I ran into it while working on Azure Automation runbooks, where I try to delete runbooks, so I’ve used this in my screenshots and error messages. There is a lock on your Azure … Continue reading FIX: Please remove the lock and try again ScopeLocked Azure

FIX: Parameter input shown as not recognized as a cmdlet AzA

My Parameter input is not recognized as a cmdlet in Azure Automation Nowadays, we roll out Azure and workplace features via a WebApp, such as Conditional Access or Privileged Identity Management for customers that need them. This speeds up the process of onboarding customers. We have adapted our WebApp in such a way that you … Continue reading FIX: Parameter input shown as not recognized as a cmdlet AzA

How to import a custom PS module in a VM or Azure Automation

Keep your PowerShell modules updated! We will do all of this with Azure Automation and PowerShell, you can also do this in a ci / cd pipeline, but that’s up to you. Disclaimer: Everything will be simplified, these are steps you can follow, but you must modify before it works in your own environment. What … Continue reading How to import a custom PS module in a VM or Azure Automation

How to fix ‘CliXml’ in parameter input Azure Automation

Azure Automation, Start-AutomationRunbook, parameters, & CliXml… I’m not going to explain what Clixml is, or what it means, nor am I going to explain exactly why this issue is happening (mainly because I don’t have a clear answer for you). I’ll give you the solution and a possible way to make this easier for you. … Continue reading How to fix ‘CliXml’ in parameter input Azure Automation

How to use Azure Managed Identities with Graph API or other Resources

Microsoft (Graph) API’s or API permissions for Managed Identities But you can only add Azure RBAC roles to a Managed Identity, right? That’s not true, in the blog post below I explain how you can add resource permissions to a Managed Identity. In my work I mainly use this for Azure Automation. By using Managed … Continue reading How to use Azure Managed Identities with Graph API or other Resources

How to use Key Vault Secrets in Azure Automation PowerShell

Azure Key Vault > Azure Automation Credential Manager Azure Automation has its own Credential Manager.This is the easiest to use, but has no history or version control.So you can’t see when the value was last changed, or who made the change within the portal (this can be done via Log Analytics). The Azure Key Vault … Continue reading How to use Key Vault Secrets in Azure Automation PowerShell