2
votes

I am trying to deploy a firewall to Azure. When I validate the template in Jenkins, it says everything is fine. When I try to run the template, it gives me an error at this point:

  "name": "SettingUpVirtualNetwork",
  "type": "Microsoft.Resources/deployments",
  "apiVersion": "2017-05-10",
  "properties": {
    "mode": "Incremental",
    "templateLink": {
      "uri": "[uri(deployment().properties.templateLink.uri, 'vnet.json')]",
      "contentVersion": "1.0.0.1"

The error reads:

"Unable to process template language expressions for resource '/subscriptions/****/resourceGroups/networks-hub-rg/providers/Microsoft.Resources/deployments/SettingUpVirtualNetwork' at line '1' and column '6637'. 'The language expression property 'templateLink' doesn't exist, available properties are 'template, parameters, mode, provisioningState'.'"

Now the Azure guidance clearly states that templateLink is perfectly valid. I have used the templateLink command before with no problems, so I don't understand why it's failing this time. Is it because of my use of "templateLink.uri" in the uri line?

Anybody encountered this error before? Any advice?

2
Worth noting that if I remove the "Link" part from the "templateLink.uri" it then tells me that the property "uri" doesn't exist.iheartnetworks

2 Answers

2
votes

When it comes to unexpected behaviour in ARM Template deployments, I always try checking the API Version. In your case, I would try following code:

  "name": "SettingUpVirtualNetwork",
  "type": "Microsoft.Resources/deployments",
  "apiVersion": "2018-05-01",
  "properties": {
    "mode": "Incremental",
    "templateLink": {
      "uri": "[uri(deployment().properties.templateLink.uri, 'vnet.json')]",
      "contentVersion": "1.0.0.1"

See https://docs.microsoft.com/en-us/azure/templates/microsoft.resources/2018-05-01/deployments

1
votes

this happens because you need to deploy the template from the uri, not from your local storage, if you do that - your code will work