Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az deployment {sub} create --template-uri... templateLink no longer available. #12990

Closed
Svessir opened this issue Apr 13, 2020 · 4 comments
Closed
Assignees
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group OKR3.2 Candidate
Milestone

Comments

@Svessir
Copy link

Svessir commented Apr 13, 2020

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az deployment create

Errors:

Deployment failed. Correlation ID: 21bcc642-ce46-4888-848b-300b1ee9634b. {
  "error": {
    "code": "InvalidTemplate",
    "message": "Unable to process template language expressions for resource '/subscriptions/c88c80a7-d849-4bce-8907-ac15d5ca178b/providers/Microsoft.Resources/deployments/innResourceGroup' at line '61' and column '5'. 'The language expression property 'templateLink' doesn't exist, available properties are 'template, templateHash, parameters, mode, provisioningState'.'",
    "additionalInfo": [
      {
        "type": "TemplateViolation",
        "info": {
          "lineNumber": 61,
          "linePosition": 5,
          "path": ""
        }
      }
    ]
  }
}

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az deployment create --name {} --location {} --template-uri {} --parameters {} --parameters {} --verbose

Expected Behavior

I used the --template-uri to supply the template so I expect deployment().properties.templateLink
to be available to use in the template like in earlier versions of az cli. I'm guessing the az cli is now downloading the template from the source and running it similar to a local template? az deployment sub create has the same behavior. I ran the templates with an earlier version of az cli successfully (version 2.0.69).

Environment Summary

Linux-5.3.0-46-generic-x86_64-with-debian-buster-sid
Python 3.6.5
Installer: DEB

azure-cli 2.3.1

Additional Context

@yonzhan yonzhan added the ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group label Apr 13, 2020
@yonzhan yonzhan added this to the S169 - For Build milestone Apr 13, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 13, 2020

add to S169

@ckittel
Copy link
Member

ckittel commented Apr 30, 2020

I can confirm this is happening as well, it looks like the template is downloaded and then provided to /validate as if it was a local file, instead of just passing the link along in templateLink

Bascially THIS is happening with az deployment group create

POST https://management.azure.com/subscriptions/<yoink>/resourcegroups/rg-vnet-dmz/providers/Microsoft.Resources/deployments/bb-03-vm/validate?api-version=2019-07-01 HTTP/1.1
Host: management.azure.com
User-Agent: python/3.6.6 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI)
Accept-Encoding: gzip, deflate
Accept: application/json
Connection: keep-alive
Authorization: Bearer <yoink>
x-ms-client-request-id: c09aefa6-8b28-11ea-83a7-c49ded299454
CommandName: deployment group create
ParameterSetName: --name --subscription --resource-group --template-uri
Content-Type: application/json; charset=utf-8
accept-language: en-US
Content-Length: 723

{
   "properties":{
      "parameters":{

      },
      "mode":"Incremental",
      "template":{
         "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
         "contentVersion":"1.0.0.0",
         "parameters":{

         },
         "variables":{
            "virtualMachineTemplate":"[deployment().properties.templateLink.uri]"
         },
         "resources":[

         ],
         "outputs":{
            "blahh":{
               "type":"object",
               "value":"[deployment().properties]"
            }
         }
      }
   }
}

Instead of:

POST https://management.azure.com/subscriptions/<yoink>/resourcegroups/rg-vnet-dmz/providers/Microsoft.Resources/deployments/bb-03-vm/validate?api-version=2019-07-01 HTTP/1.1
Host: management.azure.com
User-Agent: python/3.6.6 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI)
Accept-Encoding: gzip, deflate
Accept: application/json
Connection: keep-alive
Authorization: Bearer <yoink>
x-ms-client-request-id: c09aefa6-8b28-11ea-83a7-c49ded299454
CommandName: deployment group create
ParameterSetName: --name --subscription --resource-group --template-uri
Content-Type: application/json; charset=utf-8
accept-language: en-US
Content-Length: 196

{
   "properties":{
      "templateLink": {"uri": "https://ckmsftcloudshell01.blob.core.windows.net/anon/virtualMachines6.json"},
      "parameters":{

      },
      "mode":"Incremental"
   }
}

for the command az deployment group create --name bb-03-vm --subscription <yoink> --resource-group rg-vnet-dmz --template-uri 'https://ckmsftcloudshell01.blob.core.windows.net/anon/virtualMachines6.json'

@yonzhan
Copy link
Collaborator

yonzhan commented May 3, 2020

add to S171

@zhoxing-ms
Copy link
Contributor

Hi @Svessir, this is the same problem as #13317, and I have submitted a PR #13344 to fix it~ You can track the progress of the problem through this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group OKR3.2 Candidate
Projects
None yet
Development

No branches or pull requests

4 participants