Skip to content

Instantly share code, notes, and snippets.

@krnese
Created May 28, 2017 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krnese/3281ea35ef1d13d5970cd11bc4c138e4 to your computer and use it in GitHub Desktop.
Save krnese/3281ea35ef1d13d5970cd11bc4c138e4 to your computer and use it in GitHub Desktop.
# Webhook and runbook details
$WebhookName = 'OMS Alert Remediation ' + [System.Guid]::NewGuid().toString()
$RunbookName = 'ManagedIaaSBackup'
$WorkspaceName = 'AzureScaleWorkspace'
# Create Webhook for Runbook
$Webhook = New-AzureRmAutomationWebhook `
                -Name $WebhookName `
                -IsEnabled $True `
                -ExpiryTime (Get-Date).AddYears(2) `
                -RunbookName $RunbookName `
                -ResourceGroup $ResourceGroup `
                -AutomationAccountName $AutomationAccount `
                -Verbose
New-AzureRmResourceGroupDeployment -Name BackupRemediation `
-ResourceGroupName $ResourceGroup `
-TemplateUri 'https://raw.githubusercontent.com/krnese/AzureDeploy/master/AzureMgmt/Alerts/createOMSAlertWithBackupRemediation.json' `
-workspaceName $WorkspaceName `
-runbookName $RunbookName `
-runbookWebhookUri $Webhook.WebhookURI `
-Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment