Closed dani3lheidemann closed 5 years ago
@nnamedieh Thanks for the comment. We are actively investigating and will get back to you shortly with an update.
You can call the Watcher Automation REST API from PowerShell (https://docs.microsoft.com/en-us/rest/api/automation/watcher) An example of calling a REST API from the service using the RunAs account is documented on https://github.com/azureautomation/runbooks/blob/master/Utility/ARM/InvokeAzureREST.ps1
You can also get the token if you have logged in to Azure using ` $LoginSession = Get-AzureRMContext
$AZProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile $ProfileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($AZProfile) $Token = ($ProfileClient.AcquireAccessToken($LoginSession.Subscription.TenantId)).AccessToken
$headers = @{ 'Authorization' = "Bearer $Token" } ` Thanks, Eamon
@eamonoreilly Thanks for sharing the useful information. 👍 @nnamedieh Closing this issue for now. If there are further questions regarding this matter or feedback on the documentation, please do let us know and we will gladly continue the discussion.
Hi all, unfortunately I cannot find a powershell command / module to administer/control watcher tasks. Is there any powershell support in latest Powershell Az module?
Thanks!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.