Hi there,
I'm attempting to create a web app using code. I have a JSON template, a parameters template and a Powershell script to deploy the template. I am getting an error when I go to deploy the template using the script which is as follows:
Line |
4 | New-AzResourceGroupDeployment `
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 4:09:27 PM - Error: Code=InvalidDeployment; Message=The deployment 'createwebdev' must have either the TemplateLink or
| Template property set. Please see https://aka.ms/arm-module for usage details.
I don't know enough about what I'm doing to fix the error.
The code I have is as follows. Could someone please be kind enough to help me?
{
"$schema": "http://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string"
},
"location": {
"type": "string"
},
"sku": {
"type": "string"
},
"skucode": {
"type": "string"
}
},
"resources": [
{
"apiVersion": "2021-01-01",
"name": "[parameters('name')]",
"type": "Microsoft.Web/staticSites",
"location": "[parameters('location')]",
"tags": null,
"properties": {},
"sku": {
"tier": "[parameters('sku')]",
"name": "[parameters('skucode')]"
}
}
]
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "createwebdev"
},
"location": {
"value": "australiaeast"
},
"sku": {
"value": "Basic"
},
"skucode": {
"value": "B1"
}
}
}
$rg = 'myresourcegroup'
New-AzResourceGroup -Name $rg -Location australiaeast -Force
New-AzResourceGroupDeployment `
-Name 'createwebdev' `
-ResourceGroupName $rg `
-TemplateFile 'webapp.json' `
-TemplateParameterFile 'webappParameters.json'
If I put the code into the 'Deploy Custom Template' section on Azure Portal it keeps telling me firstly that I cannot use australiaeast as the location and secondly that the SKU name is wrong and that I can only use Free, Standard or Trial, but when I attempt to use any of these it still fails.