I have a notebook in an Azure Automation Account that I would like to call from SQL Managed Instance. Normally what I would do is to run:
Start-AzAutomationRunbook `
-AutomationAccountName "some-aa-name" `
-Name "notebook-name" `
-ResourceGroupName "rg-name" `
-Wait
My idea was to run it with a SQL Agent with a PowerShell task type. However, running it gives me an error:
The error information returned by PowerShell is: 'The term 'Start-AzAutomationRunbook' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Is there any way to make this cmdlet work on the managed instance?
Side note: I tested calling a WebHook and it works. However, it is not a very secure solution and it doesn't have the ability to wait for the completion.