runbook

Azure Runbook load .Net assembly for application insight

烈酒焚心 提交于 2019-12-31 05:50:39
问题 I have requirement where I want to write some metrics to the application insight for monitoring a service at a regular interval. I though that I would write this PowerShell script and schedule it accordingly. Write-Output "Script Start" $PSScriptRoot = Get-Location $AI = "$PSScriptRoot\Microsoft.ApplicationInsights.dll" [Reflection.Assembly]::LoadFile("$AI") $InstrumentationKey = "" $TelClient = New-Object "Microsoft.ApplicationInsights.TelemetryClient" $TelClient.InstrumentationKey =

Azure Automation Runbook ADAL SQL support

痞子三分冷 提交于 2019-12-25 04:22:19
问题 I am attempting to use an Azure Automation Runbook to run a query against an Azure SQL database using Azure AD credentials: $cred = Get-AutomationPSCredential -Name 'SqlAdminUser' $Username = $cred.UserName $Password = $cred.GetNetworkCredential().Password $Server = 'server.database.windows.net' $Port = 1433 $cxnString = "Server=tcp:$Server,$Port;Database=$Database;Authentication=Active Directory Password;UID=$UserName;PWD=$Password;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;

Azure Runbook Start/Stop Schedule Lists

纵然是瞬间 提交于 2019-12-24 10:26:34
问题 I've set up a Runbook using the Start/Stop templates from the Gallery. All set up, no errors, no warnings. Why don't any of the schedules appear under the "Schedule Runbook" but appear elsewhere in the Azure portal? Runbook_Blade Scheduler_List 回答1: Why don't any of the schedules appear under the "Schedule Runbook" but appear elsewhere in the Azure portal? Because you create the autoStopVM schedule in Azure Automation Account, this schedule just a time settings, not associate any runbook with

Azure runbook output to email

南楼画角 提交于 2019-12-24 00:45:27
问题 I am trying to send the output of a VM status from Azure automation runbook into email, I use the below code: function Send-EMail { Param ( [Parameter(Mandatory=$true)] [String]$EmailTo, [Parameter(Mandatory=$true)] [String]$Subject, [Parameter(Mandatory=$true)] [String]$Body, [Parameter(Mandatory=$false)] [String]$EmailFrom="noreply@idlebytes.com", #This gives a default value to the $EmailFrom command [parameter(Mandatory=$false)] [String] $SmtpServer = (Get-AutomationVariable -Name

Exceed 3 hours timeout Automation Runbook Azure

半城伤御伤魂 提交于 2019-12-22 10:46:02
问题 Hello guys, I have a runbook to launch but it takes more than 3 hours to run (process of partitions) and so, it stops before being complete. I wanted to know if there is a way to exceed the 3 hours limitation. I've heared about hybrid runbooks but I'm not sure how it could solve my problem. Do you know if there is other solutions ? Thanks a lot. 回答1: If you want to stick to Azure Automation, you can use Checkpoints : Azure Automation has a feature called “fairshare”, where any runbook that

Azure Automation Powershell runbook silently fails to LoadAssembly

浪子不回头ぞ 提交于 2019-12-12 03:34:18
问题 I'm new to Powershell Runbook, so forgive me if I'm missing something obvious. I'm trying to log an Application Insights request from my script, but can't even get the DLL to load, though I've seen other code out there that does something very similar. NOTE that this is a Powershell Runbook, not a Powershell Workflow Runbook. Here's my code: Write-Output "Starting" $assemblyPath = "C:\Modules\Global\Azure\Compute\Microsoft.ApplicationInsights.dll" dir $assemblyPath Write-Output "1" [System

Exceed 3 hours timeout Automation Runbook Azure

浪子不回头ぞ 提交于 2019-12-06 13:28:19
Hello guys, I have a runbook to launch but it takes more than 3 hours to run (process of partitions) and so, it stops before being complete. I wanted to know if there is a way to exceed the 3 hours limitation. I've heared about hybrid runbooks but I'm not sure how it could solve my problem. Do you know if there is other solutions ? Thanks a lot. If you want to stick to Azure Automation, you can use Checkpoints : Azure Automation has a feature called “fairshare”, where any runbook that runs for 3 hours is unloaded to allow other runbooks to run. Eventually, the unloaded runbook will be reloaded