This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "2015-05-01-preview", | |
"type": "Microsoft.Compute/virtualMachines/extensions", | |
"name": "[concat(parameters('vmNameSuffix'), 'VM', copyIndex(), '/OMS')]", | |
"location": "[resourceGroup().location]", | |
"copy": { | |
"name": "[concat(parameters('vmNameSuffix'), 'VM', 'OMS')]", | |
"count": "[parameters('instancecount')]" | |
}, | |
"dependsOn": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"location": { | |
"type": "string", | |
"defaultValue": "" | |
}, | |
"resourcegroup": { | |
"type": "string", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"subscriptionId": { | |
"type": "string", | |
"metadata": { | |
"description": "Specify the subscription Id where your storage account is located" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "2015-05-01-preview", | |
"type": "Microsoft.Compute/virtualMachines/extensions", | |
"name": "[concat(parameters('vmNameSuffix'), 'VM', copyIndex(), '/OMS')]", | |
"location": "[resourceGroup().location]", | |
"copy": { | |
"name": "[concat(parameters('vmNameSuffix'), 'VM', 'OMS')]", | |
"count": "[parameters('instancecount')]" | |
}, | |
"dependsOn": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finding protected and unprotected VMs | |
$backupVaults = Find-AzureRmResource -ResourceType Microsoft.RecoveryServices/vaults | |
foreach ($backupvault in $backupVaults) | |
{ | |
$rsVault = Get-AzureRmRecoveryServicesVault -Name $backupVault.Name -ResourceGroupName $backupVault.ResourceGroupName | |
Set-AzureRmRecoveryServicesVaultContext -Vault $rsVault | |
$azureVMs = Get-AzureRmRecoveryServicesBackupContainer -ContainerType AzureVM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting Backup Jobs | |
# Constructing the BackupJobs collection | |
$uri = "https://management.azure.com" + $vault.id + "/backupJobs?api-version=2015-11-10" | |
$restResult = Invoke-RestMethod -method Get -headers $authHeader -uri $URI | |
$backupJobs = $restResult.value | |
$backupJobs = $backupJobs.Properties | |
$resourceGroupName = $vault.id.Split('/') | |
$resourceGroupName = $resourceGroupName[4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"omsAutomationAccountName": { | |
"type": "string", | |
"metadata": { | |
"description": "Specify the name of the automation account you will create" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "2017-05-10", | |
"type": "Microsoft.Resources/deployments", | |
"resourceGroup": "[parameters('omsResourceGroup')]", | |
"name": "enableBackup", | |
"dependsOn": [ | |
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNameSuffix'), 'VM0', '/extensions/', 'OMS')]" | |
], | |
"properties": { | |
"mode": "Incremental", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"copy": { | |
"name": "modulesCopy", | |
"count": "[length(variables('assets').psModules)]", | |
"batchSize": 4, | |
"mode": "Serial" | |
} |
OlderNewer