Authoratative Source Dcoumentation for Azure ARM Template Schema - powershell

I am looking for the official documentation for Azure Desired State Configuration JSON schemas. Documentation and examples I find online go back quite a while and I feel the schemas I am using are not current. I am currently seeking the most current schema and a description of the fields for Microsoft.Powershell.DSC. This is the schema Visual Studio provides but I would like to have a complete understanding of each field and values they expect.
{
"name": "Microsoft.Powershell.DSC",
"type": "extensions",
"location": "[parameters('location')]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', parameters('vm-SP1-Name'))]"
],
"tags": {
"displayName": "test"
},
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.9",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "[parameters('testUpdateTagVersion')]",
"settings": {
"configuration": {
"url": "[concat(parameters('_artifactsLocation'), '/', variables('testArchiveFolder'), '/', variables('testArchiveFileName'))]",
"script": "test.ps1",
"function": "Main"
},
"configurationArguments": {
"nodeName": "[parameters('vm-SP1-Name')]"
}
},
"protectedSettings": {
"configurationUrlSasToken": "[parameters('_artifactsLocationSasToken')]"
}
}
}

The official schema definition for the ARM PowerShell Desired State Configuration (DSC) JSON Schema can be found at the link below:
Schema Json
"dscExtension": {
"type": "object",
"properties": {
"publisher": {
"enum": ["Microsoft.Powershell"]
},
"type": {
"enum": ["DSC"]
},
"typeHandlerVersion": {
"type": "string",
"minLength": 1
},
"autoUpgradeMinorVersion": {
"type": "boolean"
},
"settings": {
"type": "object",
"properties": {
"modulesUrl": {
"type": "string"
},
"configurationFunction": {
"type": "string"
},
"properties": {
"type": "string"
},
"wmfVersion": {
"type": "string"
},
"privacy": {
"type": "object",
"properties": {
"dataCollection": {
"type": "string"
}
}
}
},
"required": ["modulesUrl", "configurationFunction"]
},
"protectedSettings": {
"type": "object",
"properties": {
"dataBlobUri": {
"type": "string"
}
}
}
},
"required": ["publisher", "type", "typeHandlerVersion", "autoUpgradeMinorVersion", "settings", "protectedSettings"]
},

The schema was documented in this blog. Feel free to ping me on the PowerShell slack (preferred) or twitter if you have any questions, #TravisPlunk. If I don't know, I can direct them to the right place.

Related

How to encrypt Azure Data Factory with CMK (customer managed key)

Parameters.json
"parameters": {
"dataFactoryName": { "type": "string", "metadata": { "description": "Name of the data factory. Name must be globally unique" } },
"resourceTags": { "type": "object" },
"diagnosticSettingsStorageAccount": { "type": "string", "metadata": { "description": "Resource ID of the storage account used to store diagnostic logs" } },
"cmkIdentity": {
"type": "string"
},
"vaultBaseUrl": {
"type": "string"
},
"keyName": {
"type": "string"
},
"keyVersion": {
"type": "string"
}
},
Template.json
{
"type": "Microsoft.DataFactory/factories",
"apiVersion": "2018-06-01",
"name": "[parameters('dataFactoryName')]",
"location": "[resourceGroup().location]",
"tags": "[parameters('resourceTags')]",
"identity": {
"type": "SystemAssigned,UserAssigned",
"userAssignedIdentities": {"[parameters('cmkIdentity')]": {}}},
"properties": {
"publicNetworkAccess": "Disabled",
"encryption": {
"identity": {
"userAssignedIdentity": "[parameters('cmkIdentity')]"
},
"vaultBaseUrl": "[parameters('vaultBaseUrl')]",
"keyName": "[parameters('keyName')]",
"keyVersion": "[parameters('keyVersion')]"
}
},
"dependsOn": ["[resourceId('Microsoft.OperationalInsights/workspaces',variables('workspaceName'))]"]
},
I am passing these values in:
cmkIdentity: "/subscriptions/xxxxx/resourcegroups/xxxxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity"
vaultBaseUrl: https://testkeyvault123.vault.azure.net/
keyName: test-key
keyVersion: t5dca2a5xxxxx399we5
The Validation passes and the Data Factory is deployed. I can see the test-identity in the Managed Identity section. But when I open the Data Factory's UI and navigate to Manage and in Customer managed key I don't see anything. All fields are empty, see picture below:
Provided access policy to test-identity to the test key vault. Can't figure out what the problem is.
UPDATED parameters and template
parameters
"parameters": {
"dataFactoryName": { "type": "string", "metadata": { "description": "Name of the data factory. Name must be globally unique" } },
"resourceTags": { "type": "object" },
"diagnosticSettingsStorageAccount": { "type": "string", "metadata": { "description": "Resource ID of the storage account used to store diagnoistic logs" } },
"cmkIdentity": {
"type": "object",
"defaultValue": {
"/subscriptions/xxxxx/resourcegroups/xxxxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {
}
}
},
"vaultBaseUrl": {
"type": "string"
},
"keyName": {
"type": "string"
},
"keyVersion": {
"type": "string"
}
},
template.json
{
"type": "Microsoft.DataFactory/factories",
"apiVersion": "2018-06-01",
"name": "[parameters('dataFactoryName')]",
"location": "[resourceGroup().location]",
"tags": "[parameters('resourceTags')]",
"identity": {
"type": "SystemAssigned,UserAssigned",
"principalId": "",
"tenantId": "",
"userAssignedIdentities": "[parameters('cmkIdentity')]"
},
"properties": {
"publicNetworkAccess": "Disabled",
"encryption": {
"identity": {
"userAssignedIdentity": "[parameters('cmkIdentity')]"
},
"vaultBaseUrl": "[parameters('vaultBaseUrl')]",
"keyName": "[parameters('keyName')]",
"keyVersion": "[parameters('keyVersion')]"
}
},
"dependsOn": ["[resourceId('Microsoft.OperationalInsights/workspaces',variables('workspaceName'))]"]
},
I have tried doing it both the ways via json template and even through portal works fine, just to have another parameter which is object type as below:
Updated Info : Please add a new parameter as an cmkidentity_obj which is type: object and have the other parameter cmkidentity as type: string
and pass the string in :
"encryption": {
"identity": {
"userAssignedIdentity": "[parameters('cmkidentity')]"
},
"VaultBaseUrl": "[parameters('dataFactory_properties_encryption_VaultBaseUrl')]",
"KeyName": "[parameters('dataFactory_properties_encryption_KeyName')]",
"KeyVersion": "[parameters('dataFactory_properties_encryption_KeyVersion')]"
}
Parameter- cmkidentity_obj abd pass it in below template.json :
"cmkidentity_obj": {
"type": "object",
"defaultValue": {
"/subscriptions/xxxxx/resourcegroups/xxxxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {
}
}
}
and then passed this object in my template.json :
"identity": {
"type": "[parameters('dataFactory_identity_type')]",
"principalId": "",
"tenantId": "",
"userAssignedIdentities": "[parameters('cmkidentity_obj')]"
}
This deployed successfully with about any error and was able to view my Customer Managed Key in Azure Data Factory(UI), kindly try the same and see.
My Template.json:
"resources": [
{
"name": "[parameters('factoryName')]",
"type": "Microsoft.DataFactory/factories",
"apiVersion": "2018-06-01",
"properties": {
"encryption": {
"identity": {
"userAssignedIdentity": "[parameters('cmkidentity')]"
},
"VaultBaseUrl": "[parameters('dataFactory_properties_encryption_VaultBaseUrl')]",
"KeyName": "[parameters('dataFactory_properties_encryption_KeyName')]",
"KeyVersion": "[parameters('dataFactory_properties_encryption_KeyVersion')]"
}
},
"dependsOn": [],
"location": "[parameters('dataFactory_location')]",
"identity": {
"type": "[parameters('dataFactory_identity_type')]",
"principalId": "",
"tenantId": "",
"userAssignedIdentities": "[parameters('cmkIdentity_obj')]"
}
}
]

How to reference already existing Azure Portal created storage accounts in an ARM template

I want to create a function app with ARM template such that the ARM template references already existing storage accounts (inputstgdev and outputstgdev) which I have already parameterized. I would like the ARM template to use the inputstgdev storage account as its attached storage account such that it does not have to create a new storage account. The source control of the function app is referenced to a Gitrepo which I have also parameterized in the ARM template. Each time I run the ARM template I get the following error message
##[error]Deployment template validation failed: 'The resource '/subscriptions/bea8ac84-24a4-4e53-9198-e3b0107547d4/resourceGroups/dev-rgp/providers/Microsoft.Web/sites/functionapp/sourcecontrols/web' at line '1' and column '3069' doesn't depend on parent resource '/subscriptions/bea8ac84-24a4-4e53-9198-e3b0107547d4/resourceGroups/dev-rgp/providers/Microsoft.Web/sites/functionapp'. Please add dependency explicitly using the 'dependsOn' syntax. Please see aka.ms/arm-template/#resources for
Any suggestions what the issue might be or possible solutions.
I look forward to your response
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"InputstorageAccount": {
"defaultValue": "inputstgdev",
"type": "String"
},
"GitrepoBranch": {
"type": "string",
"defaultValue": "master",
"metadata": {
"description": "Name of the branch to use when deploying (Default = master)."
}
},
"GitrepoURL": {
"type": "string",
"defaultValue": "https://github.com/FBoucher/AzUnzipEverything.git",
"metadata": {
"description": "URL to repo (Default = master)."
}
},
"InputcontainerName": {
"type": "string",
"defaultValue": "inputcontainer",
"metadata": {
"description": "Specifies the name of the blob container."
}
},
"OutputstorageAccount": {
"defaultValue": "outputstgdev",
"type": "String"
},
"OutputcontainerName": {
"type": "string",
"defaultValue": "outputcontainer",
"metadata": {
"description": "Specifies the name of the blob container."
}
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('InputstorageAccount'), '/default/', parameters('InputcontainerName'))]",
"properties": {
"publicAccess": "None"
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('OutputstorageAccount'), '/default/', parameters('OutputcontainerName'))]",
"properties": {
"publicAccess": "None"
}
},
{
"name": "serviceplan",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "serviceplan"
},
"properties": {
"name": "serviceplan"
}
},
{
"name": "functionapp",
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'serviceplan')]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('InputstorageAccount'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'serviceplan')]",
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('InputstorageAccount'), ';AccountKey=', listKeys(parameters('InputcontainerName'),'2015-05-01-preview').key1)]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('InputstorageAccount'), ';AccountKey=', listKeys(parameters('InputcontainerName'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('InputstorageAccount'), ';AccountKey=', listKeys(parameters('InputcontainerName'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower('functionapp')]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', 'applicationInsightsName'), '2015-05-01').InstrumentationKey]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
}
]
}
},
"resources":[
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', parameters('InputstorageAccount'))]"
],
"properties": {
"RepoUrl": "[parameters('GitrepoURL')]",
"branch": "[parameters('GitrepoBranch')]",
"publishRunbook": true,
"IsManualIntegration": true
}
}
]
}
]
}
You encountered this error message due to the wrong dependency.
You should use "[resourceId('Microsoft.Web/sites/', 'functionapp')]" instead of "[resourceId('Microsoft.Web/sites/', parameters('InputstorageAccount'))]".
And you should delete the storage dependency.
"[resourceId('Microsoft.Storage/storageAccounts', parameters('InputstorageAccount'))]"
By the way, as you already have a storage account, you just need to paste your connection string in the value of AzureWebJobsStorage and AzureWebJobsDashboard.
Just like
{
"name": "AzureWebJobsDashboard",
"value": "{connectionstring}"
}

Importing ARM template for creating ADF resources not creating any

I am new to ADF & ARM. I have a blank Data Factory-v2(TestDataFactory-123Test) which I want to get it populated using an existing ADF(TestDataFactory-123). I followed step by step what is mentioned in the official documentation Create a Resource Manager template for each environment. The deployment shows succeeded but I can't see anything in it. I used 'Build your own template in the editor' option in the portal for importing the existing ARM template. Am I missing anything?
Below is the ARM which I got by 'exporting' the ARM for TestDataFactory-123:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"factoryName": {
"type": "string",
"metadata": "Data Factory name",
"defaultValue": "TestDataFactory-123"
},
"AzureBlobStorageLinkedService_connectionString": {
"type": "secureString",
"metadata": "Secure string for 'connectionString' of 'AzureBlobStorageLinkedService'",
"defaultValue": "TestDataFactory-123"
}
},
"variables": {
"factoryId": "[concat('Microsoft.DataFactory/factories/', parameters('factoryName'))]"
},
"resources": [
{
"name": "[concat(parameters('factoryName'), '/AzureBlobStorageLinkedService')]",
"type": "Microsoft.DataFactory/factories/linkedServices",
"apiVersion": "2018-06-01",
"properties": {
"annotations": [],
"type": "AzureBlobStorage",
"typeProperties": {
"connectionString": "[parameters('AzureBlobStorageLinkedService_connectionString')]"
}
},
"dependsOn": []
},
{
"name": "[concat(parameters('factoryName'), '/InputDataset')]",
"type": "Microsoft.DataFactory/factories/datasets",
"apiVersion": "2018-06-01",
"properties": {
"linkedServiceName": {
"referenceName": "AzureBlobStorageLinkedService",
"type": "LinkedServiceReference"
},
"annotations": [],
"type": "Binary",
"typeProperties": {
"location": {
"type": "AzureBlobStorageLocation",
"fileName": "emp.txt",
"folderPath": "input",
"container": "adftutorial"
}
}
},
"dependsOn": [
"[concat(variables('factoryId'), '/linkedServices/AzureBlobStorageLinkedService')]"
]
},
{
"name": "[concat(parameters('factoryName'), '/OutputDataset')]",
"type": "Microsoft.DataFactory/factories/datasets",
"apiVersion": "2018-06-01",
"properties": {
"linkedServiceName": {
"referenceName": "AzureBlobStorageLinkedService",
"type": "LinkedServiceReference"
},
"annotations": [],
"type": "Binary",
"typeProperties": {
"location": {
"type": "AzureBlobStorageLocation",
"folderPath": "output",
"container": "adftutorial"
}
}
},
"dependsOn": [
"[concat(variables('factoryId'), '/linkedServices/AzureBlobStorageLinkedService')]"
]
},
{
"name": "[concat(parameters('factoryName'), '/CopyPipeline')]",
"type": "Microsoft.DataFactory/factories/pipelines",
"apiVersion": "2018-06-01",
"properties": {
"activities": [
{
"name": "CopyFromBlobToBlob",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "BinarySource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true
}
},
"sink": {
"type": "BinarySink",
"storeSettings": {
"type": "AzureBlobStorageWriteSettings"
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "InputDataset",
"type": "DatasetReference",
"parameters": {}
}
],
"outputs": [
{
"referenceName": "OutputDataset",
"type": "DatasetReference",
"parameters": {}
}
]
}
],
"annotations": []
},
"dependsOn": [
"[concat(variables('factoryId'), '/datasets/InputDataset')]",
"[concat(variables('factoryId'), '/datasets/OutputDataset')]"
]
}
]
}
The fix was as simple as replacing the 'defaultValue' for the 'factoryName' parameter with the name of the empty data factory viz. 'TestDataFactory-123Test' and not the existing one 'TestDataFactory-123'! Also, I replaced the 'defaultValue' of the 'AzureBlobStorageLinkedService_connectionString' parameter with the actual connection string.

Getting error on null and empty string while copying a csv file from blob container to Azure SQL DB

I tried all combination on the datatype of my data but each time my data factory pipeline is giving me this error:
{
"errorCode": "2200",
"message": "ErrorCode=UserErrorColumnNameNotAllowNull,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Empty or Null string found in Column Name 2. Please make sure column name not null and try again.,Source=Microsoft.DataTransfer.Common,'",
"failureType": "UserError",
"target": "xxx",
"details": []
}
My Copy data source code is something like this:{
"name": "xxx",
"description": "uuu",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true,
"wildcardFileName": "*"
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "AzureSqlSink"
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"mappings": [
{
"source": {
"name": "populationId",
"type": "Guid"
},
"sink": {
"name": "PopulationID",
"type": "String"
}
},
{
"source": {
"name": "inputTime",
"type": "DateTime"
},
"sink": {
"name": "inputTime",
"type": "DateTime"
}
},
{
"source": {
"name": "inputCount",
"type": "Decimal"
},
"sink": {
"name": "inputCount",
"type": "Decimal"
}
},
{
"source": {
"name": "inputBiomass",
"type": "Decimal"
},
"sink": {
"name": "inputBiomass",
"type": "Decimal"
}
},
{
"source": {
"name": "inputNumber",
"type": "Decimal"
},
"sink": {
"name": "inputNumber",
"type": "Decimal"
}
},
{
"source": {
"name": "utcOffset",
"type": "String"
},
"sink": {
"name": "utcOffset",
"type": "Int32"
}
},
{
"source": {
"name": "fishGroupName",
"type": "String"
},
"sink": {
"name": "fishgroupname",
"type": "String"
}
},
{
"source": {
"name": "yearClass",
"type": "String"
},
"sink": {
"name": "yearclass",
"type": "String"
}
}
]
}
},
"inputs": [
{
"referenceName": "DelimitedTextFTDimensions",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "AzureSqlTable1",
"type": "DatasetReference"
}
]
}
Can anyone please help me understand the issue. I see in some blogs they ask me use treatnullasempty but I am not allowed to modify the JSON. is there a way to do that??
I suggest to using Data Flow DerivedColumn, DerivedColumn can help you build expression to replace the null column.
For example:
Derived Column, if Column_2 is null =true, return 'dd' :
iifNull(Column_2,'dd')
Mapping the column
Reference: Data transformation expressions in mapping data flow
Hope this helps.
fixed it.it was a easy fix as one of my column in destination was marked as not null, i changed it as null and it worked.

Input for create or update policy is not in proper format (.json Template in PowerShell-Script)

I'm trying to deploy a resource group from a powershell script. The script gets the parameters etc. from a .json template.
For another resource group it worked fine (I just had to insert the "adminPassword" parameter), but now I have another resoruce group, which I can't redeploy from this script. First I thougt I just have to add the parameter before, but this template has a different structure, etc. So that means that I cannot find the place to insert the parameter.
But this isn't the problem. When I run the script, I'm getting the following error:
New-AzureRmResourceGroupDeployment : 08:35:01 - Resource Microsoft.RecoveryServices/vaults/backupPolicies 'alp-prd-core-rsvault1/DefaultPolicy' failed with message '{
"error": {
"code": "BMSUserErrorInvalidPolicyInput",
"message": "Input for create or update policy is not in proper format\r\nPlease check format of parameters like schedule time, schedule days, retention time and retention days ",
"target": null,
"details": null,
"innerError": null
(Sorry for bad format)
I looked in the template and one of the parameter the powershell doesn't like is the following:
"backupPolicies_DefaultPolicy_name": {
"type": "String",
"defaultValue": "DefaultPolicy"
},
It's like the documentation from Microsoft (https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-deploy)
So for that I don't know why this doesn't work, for the other Resource Group with their template it worked.
I hope you understand my issue.
Thanks in advance!
P.S. Template: {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworks_alp_prd_core_vnet1_name": {
"defaultValue": "alp-prd-core-vnet1",
"type": "String"
},
"vaults_alp_prd_core_rsvault1_name": {
"defaultValue": "alp-prd-core-rsvault1",
"type": "String"
},
"subnets_internal_name": {
"defaultValue": "internal",
"type": "String"
},
"backupPolicies_DefaultPolicy_name": {
"defaultValue": "DefaultPolicy",
"type": "String"
},
"backupPolicies_HourlyLogBackup_name": {
"defaultValue": "HourlyLogBackup",
"type": "String"
},
"backupPolicies_%name%_Backup_Policy_name": {
"defaultValue": "%name%-Backup-Policy",
"type": "String"
},
"replicationAlertSettings_defaultAlertSetting_name": {
"defaultValue": "defaultAlertSetting",
"type": "String"
},
"virtualNetworkPeerings_alp_prd_core_vnet1_Net_Sync_name": {
"defaultValue": "alp-prd-core-vnet1-Net-Sync",
"type": "String"
},
"virtualNetworks_alp_prd_core_vnet1_id": {
"defaultValue": "/subscriptions/%subsciptionID%/resourceGroups/NemetschekgroupAD/providers/Microsoft.Network/virtualNetworks/Net-Sync",
"type": "String"
},
"virtualNetworkPeerings_alp_prd_core_vnet1_Net_Sync_id": {
"defaultValue": "/subscriptions/%subsciptionID%/resourceGroups/NemetschekgroupAD/providers/Microsoft.Network/virtualNetworks/Net-Sync",
"type": "String"
}
},
"variables": {},
"resources": [
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourceGroups/alp-prd-core-rg/providers/Microsoft.Network/virtualNetworks/alp-prd-core-vnet1'.",
"type": "Microsoft.Network/virtualNetworks",
"name": "[parameters('virtualNetworks_alp_prd_core_vnet1_name')]",
"apiVersion": "2018-02-01",
"location": "westeurope",
"scale": null,
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "940c1d33-bbf4-4b01-a331-8096e8066a0a",
"addressSpace": {
"addressPrefixes": [
"10.11.0.112/28"
]
},
"subnets": [
{
"name": "internal",
"etag": "W/\"b5fce13f-36b0-4d55-aa19-755a78b696f2\"",
"properties": {
"provisioningState": "Succeeded",
"addressPrefix": "10.11.0.112/28"
}
}
],
"virtualNetworkPeerings": [
{
"name": "[concat(parameters('virtualNetworks_alp_prd_core_vnet1_name'),'-Net-Sync')]",
"etag": "W/\"b5fce13f-36b0-4d55-aa19-755a78b696f2\"",
"properties": {
"provisioningState": "Succeeded",
"peeringState": "Connected",
"remoteVirtualNetwork": {
"id": "[parameters('virtualNetworks_alp_prd_core_vnet1_id')]"
},
"allowVirtualNetworkAccess": true,
"allowForwardedTraffic": false,
"allowGatewayTransit": false,
"useRemoteGateways": true,
"remoteAddressSpace": {
"addressPrefixes": [
"10.11.0.0/28",
"10.11.0.16/28"
]
}
}
}
],
"enableDdosProtection": false,
"enableVmProtection": false
},
"dependsOn": []
},
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourceGroups/alp-prd-core-rg/providers/Microsoft.RecoveryServices/vaults/alp-prd-core-rsvault1'.",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "RS0",
"tier": "Standard"
},
"name": "[parameters('vaults_alp_prd_core_rsvault1_name')]",
"apiVersion": "2018-01-10",
"location": "westeurope",
"scale": null,
"properties": {},
"dependsOn": []
},
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourceGroups/alp-prd-core-rg/providers/Microsoft.Network/virtualNetworks/alp-prd-core-vnet1/subnets/internal'.",
"type": "Microsoft.Network/virtualNetworks/subnets",
"name": "[concat(parameters('virtualNetworks_alp_prd_core_vnet1_name'), '/', parameters('subnets_internal_name'))]",
"apiVersion": "2018-02-01",
"scale": null,
"properties": {
"provisioningState": "Succeeded",
"addressPrefix": "10.11.0.112/28"
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_alp_prd_core_vnet1_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourceGroups/alp-prd-core-rg/providers/Microsoft.Network/virtualNetworks/alp-prd-core-vnet1/virtualNetworkPeerings/alp-prd-core-vnet1-Net-Sync'.",
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"name": "[concat(parameters('virtualNetworks_alp_prd_core_vnet1_name'), '/', parameters('virtualNetworkPeerings_alp_prd_core_vnet1_Net_Sync_name'))]",
"apiVersion": "2018-02-01",
"scale": null,
"properties": {
"provisioningState": "Succeeded",
"peeringState": "Connected",
"remoteVirtualNetwork": {
"id": "[parameters('virtualNetworkPeerings_alp_prd_core_vnet1_Net_Sync_id')]"
},
"allowVirtualNetworkAccess": true,
"allowForwardedTraffic": false,
"allowGatewayTransit": false,
"useRemoteGateways": true,
"remoteAddressSpace": {
"addressPrefixes": [
"10.11.0.0/28",
"10.11.0.16/28"
]
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_alp_prd_core_vnet1_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourcegroups/alp-prd-core-rg/providers/Microsoft.RecoveryServices/vaults/alp-prd-core-rsvault1/backupPolicies/%name%-Backup-Policy'.",
"type": "Microsoft.RecoveryServices/vaults/backupPolicies",
"name": "[concat(parameters('vaults_alp_prd_core_rsvault1_name'), '/', parameters('backupPolicies_%name%_Backup_Policy_name'))]",
"apiVersion": "2016-12-01",
"scale": null,
"properties": {
"backupManagementType": "AzureIaasVM",
"protectedItemsCount": 0
},
"dependsOn": [
"[resourceId('Microsoft.RecoveryServices/vaults', parameters('vaults_alp_prd_core_rsvault1_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourcegroups/alp-prd-core-rg/providers/Microsoft.RecoveryServices/vaults/alp-prd-core-rsvault1/backupPolicies/HourlyLogBackup'.",
"type": "Microsoft.RecoveryServices/vaults/backupPolicies",
"name": "[concat(parameters('vaults_alp_prd_core_rsvault1_name'), '/', parameters('backupPolicies_HourlyLogBackup_name'))]",
"apiVersion": "2016-12-01",
"scale": null,
"properties": {
"backupManagementType": "AzureWorkload",
"protectedItemsCount": 0
},
"dependsOn": [
"[resourceId('Microsoft.RecoveryServices/vaults', parameters('vaults_alp_prd_core_rsvault1_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/%subsciptionID%/resourcegroups/alp-prd-core-rg/providers/Microsoft.RecoveryServices/vaults/alp-prd-core-rsvault1/backupPolicies/DefaultPolicy'.",
"type": "Microsoft.RecoveryServices/vaults/backupPolicies",
"name": "[concat(parameters('vaults_alp_prd_core_rsvault1_name'), '/', parameters('backupPolicies_DefaultPolicy_name'))]",
"apiVersion": "2016-12-01",
"scale": null,
"properties": {
"backupManagementType": "AzureIaasVM",
"protectedItemsCount": 0
},
"dependsOn": [
"[resourceId('Microsoft.RecoveryServices/vaults', parameters('vaults_alp_prd_core_rsvault1_name'))]"
]
},
{
"comments": "Generalized from resource: '/Subscriptions/%subsciptionID%/resourceGroups/alp-prd-core-rg/providers/Microsoft.RecoveryServices/vaults/alp-prd-core-rsvault1/replicationAlertSettings/defaultAlertSetting'.",
"type": "Microsoft.RecoveryServices/vaults/replicationAlertSettings",
"name": "[concat(parameters('vaults_alp_prd_core_rsvault1_name'), '/', parameters('replicationAlertSettings_defaultAlertSetting_name'))]",
"apiVersion": "2018-01-10",
"scale": null,
"properties": {
"sendToOwners": "DoNotSend",
"customEmailAddresses": [],
"locale": ""
},
"dependsOn": [
"[resourceId('Microsoft.RecoveryServices/vaults', parameters('vaults_alp_prd_core_rsvault1_name'))]"
]
}
]
}
To me it seems like your template is missing the actual schedule, required for a successfuly backup policy deployment. I realize that you have exported the template from an existing deployment, but for some reason the policy itself is included, without the actual schedule (meaning when to back up virtual machines). Not sure why it is not included in the exported template.
I suggest you take an existing template - for example this https://github.com/Azure/azure-quickstart-templates/blob/master/101-recovery-services-daily-backup-policy-create/azuredeploy.json as a baseline and edit your existing template to include all the necessary properties. Use that template as a reference, and you should end up with a working template.