This sample contains a script to easily migrate template gallery templates to templateSpec resources.

{"type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "ansibleroleassignment", "dependson": ["[resourceid('microsoft.compute/virtualmachines", variables('ansible_vm_name'))]", "[resourceid('microsoft.resources/deployments","ansibleaccesspolicy')]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('role_assignment_template')]"}, "parameters": {"roleassignmentname": {"value": "[guid(resourceid('microsoft.compute/virtualmachines", variables('ansible_vm_name')), variables('reader_role'), variables('rbacprincipalid'))]"}, "roledefinitionid": {"value": "[variables('reader_role')]"}, "principalid": {"value": "[reference(resourceid('microsoft.compute/virtualmachines",variables('ansible_vm_name')),"2019-07-01","full').identity.principalid]"}}}}{"type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "ansibleaccesspolicy", "dependson": ["[resourceid('microsoft.compute/virtualmachines", variables('ansible_vm_name'))]", "[resourceid('microsoft.keyvault/vaults", variables('key_vault_name'))]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('access_policy_template')]"}, "parameters": {"keyvaultname": {"value": "[variables('key_vault_name')]"}, "tenantid": {"value": "[variables('tenantid')]"}, "objectid": {"value": "[reference(resourceid('microsoft.compute/virtualmachines",variables('ansible_vm_name')),"2019-12-01", "full').identity.principalid]"}, "secretspermissions": {"value": "[variables('secretspermissions')]"}, "keyspermissions": {"value": "[variables('keyspermissions')]"}, "certificatespermissions": {"value": "[variables('certificatespermissions')]"}}}}{"type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "phase1-ansiblehostsetup", "dependson": ["[resourceid('microsoft.compute/virtualmachines", variables('ansible_vm_name'))]", "[resourceid('microsoft.resources/deployments","ansibleaccesspolicy')]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('linux_extension_template')]"}, "parameters": {"location": {"value": "[parameters('location')]"}, "vmname": {"value": "[variables('ansible_vm_name')]"}, "commandtoexecute": {"value": "[concat('mkdir -p /var/log/sas/install && set -o pipefail; ./ansible_setup.sh"," ",parameters('storageaccountname')," ",parameters('filesharename')," ",parameters('viyarepofolder')," ",parameters('sasapplicationname')," ",variables('domain_name')," ",variables('ansible_vm_name')," ",variables('microservices_vm_name')," ",variables('cascontroller_vm_name')," ",variables('spre_vm_name')," ",variables('casworker_vm_name')," ",variables('key_vault_secretname_sasinst')," ",variables('key_vault_secretname_sasext')," ",variables('key_vault_name')," ",variables('key_vault_secretname_pvtkey')," ",variables('key_vault_secretname_pubkey')," ",parameters('numberofviyacasnodes')," ",variables('mid_vm_name')," ",parameters('_artifactslocation')," ",variables('compute_vm_name')," ",variables('meta_vm_name')," ",variables('key_vault_secretname_stgacc')," ",variables('storage_account_uri')," ","2>&1 | tee /var/log/sas/install/runphase1_hostsetup.log')]"}, "filepath": {"value": "scripts/ansible_setup.sh"}, "_artifactslocation": {"value": "[parameters('_artifactslocation')]"}, "_artifactslocationsastoken": {"value": "[parameters('_artifactslocationsastoken')]"}}}}{"type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "phase2-ansiblesslcopy", "dependson": ["[resourceid('microsoft.compute/virtualmachines", variables('ansible_vm_name'))]", "[resourceid('microsoft.resources/deployments","phase2-metainstall')]", "[resourceid('microsoft.resources/deployments","phase2-midinstall')]", "[resourceid('microsoft.resources/deployments","phase2-computeinstall')]", "[resourceid('microsoft.resources/deployments","phase4-viyainstallpart2')]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('linux_extension_template')]", "contentversion": "1.0.0.0"}, "parameters": {"location": {"value": "[parameters('location')]"}, "vmname": {"value": "[variables('ansible_vm_name')]"}, "commandtoexecute": {"value": "[concat('set -o pipefail;./ansible_ssl.sh 2>&1 | tee /var/log/sas/install/runphase2ansiblesslcopy.log;')]"}, "filepath": {"value": "scripts/ansible_ssl.sh"}, "_artifactslocation": {"value": "[parameters('_artifactslocation')]"}, "_artifactslocationsastoken": {"value": "[parameters('_artifactslocationsastoken')]"}}}}{"type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "phase3-viyainstallpart1", "dependson": ["[resourceid('microsoft.resources/deployments", "phase1-ansiblehostsetup')]", "[resourceid('microsoft.resources/deployments", "phase2-microservicesviyaark')]", "[resourceid('microsoft.resources/deployments", "phase2-spreviyaark')]", "[resourceid('microsoft.resources/deployments", "phase2-cascontrollerviyaark')]", "casworkerviyaarkcopy"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('linux_extension_template')]"}, "parameters": {"location": {"value": "[parameters('location')]"}, "vmname": {"value": "[variables('ansible_vm_name')]"}, "commandtoexecute": {"value": "[concat('set -o pipefail;","./viyainstall.sh"," ", "1"," ","2>&1 | tee /var/log/sas/install/runphase3_viyainstallpart1.log')]"}, "filepath": {"value": "scripts/viyainstall.sh"}, "_artifactslocation": {"value": "[parameters('_artifactslocation')]"}, "_artifactslocationsastoken": {"value": "[parameters('_artifactslocationsastoken')]"}}}}