{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/1307","repository_url":"https://api.github.com/repos/Microsoft/vsts-agent","labels_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/1307/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/1307/comments","events_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/1307/events","html_url":"https://github.com/Microsoft/vsts-agent/issues/1307","id":276970326,"node_id":"MDU6SXNzdWUyNzY5NzAzMjY=","number":1307,"title":"Azure subscription endpoint ID cannot be provided through a variable in build definition YAML file","user":{"login":"A141133","id":32254152,"node_id":"MDQ6VXNlcjMyMjU0MTUy","avatar_url":"https://avatars2.githubusercontent.com/u/32254152?v=4","gravatar_id":"","url":"https://api.github.com/users/A141133","html_url":"https://github.com/A141133","followers_url":"https://api.github.com/users/A141133/followers","following_url":"https://api.github.com/users/A141133/following{/other_user}","gists_url":"https://api.github.com/users/A141133/gists{/gist_id}","starred_url":"https://api.github.com/users/A141133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/A141133/subscriptions","organizations_url":"https://api.github.com/users/A141133/orgs","repos_url":"https://api.github.com/users/A141133/repos","events_url":"https://api.github.com/users/A141133/events{/privacy}","received_events_url":"https://api.github.com/users/A141133/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2017-11-27T10:35:18Z","updated_at":"2018-07-07T07:59:33Z","closed_at":"2017-12-08T00:37:11Z","author_association":"NONE","body":"## Agent version and platform\r\nVersion of your agent? 2.120.1\r\n\r\nOS of the machine running the agent? Linux and Windows\r\n\r\n## VSTS type and version\r\nVisualStudio.com\r\n\r\nIf VisualStudio.com, what is your account name? https://aglthundercats.visualstudio.com\r\n\r\n## What's not working?\r\nWhen using the new build definition YAML format with the `AzureCLI@1` and `Docker@0` tasks, we cannot specify an Azure subscription ID connection using a VSTS variable. For example, this step definition works fine:\r\n\r\n``` yaml\r\n- task: AzureCLI@1\r\n  displayName: Upload Image Archive\r\n  inputs:\r\n    connectedServiceNameARM: ********-****-****-****-************\r\n    scriptLocation: inlineScript\r\n    failOnStandardError: false\r\n    inlineScript: pwsh build/Build.ps1\r\n```\r\n\r\nBut this one does not:\r\n\r\n\r\n``` yaml\r\n- task: AzureCLI@1\r\n  displayName: Upload Image Archive\r\n  inputs:\r\n    connectedServiceNameARM: $(AzureSubscriptionEndpointId)\r\n    scriptLocation: inlineScript\r\n    failOnStandardError: false\r\n    inlineScript: pwsh build/Build.ps1\r\n```\r\n\r\nWhen I try using that step definition, I get this error:\r\n\r\n```\r\nAn error occurred while loading the YAML build definition. A service endpoint with name $(AzureSubscriptionEndpointId) could not be found. The service endpoint does not exist or has not been authorized for use.\r\n```\r\n\r\nThis suggests that the variable substitution doesn't work for these YAML files. I would have expected to be able to provide my Azure subscription ID through a variable, to avoid hard-coding it into my YAML file."},"comment":{"url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/comments/403197223","html_url":"https://github.com/Microsoft/vsts-agent/issues/1307#issuecomment-403197223","issue_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/1307","id":403197223,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzE5NzIyMw==","user":{"login":"ericsciple","id":12102068,"node_id":"MDQ6VXNlcjEyMTAyMDY4","avatar_url":"https://avatars1.githubusercontent.com/u/12102068?v=4","gravatar_id":"","url":"https://api.github.com/users/ericsciple","html_url":"https://github.com/ericsciple","followers_url":"https://api.github.com/users/ericsciple/followers","following_url":"https://api.github.com/users/ericsciple/following{/other_user}","gists_url":"https://api.github.com/users/ericsciple/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsciple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsciple/subscriptions","organizations_url":"https://api.github.com/users/ericsciple/orgs","repos_url":"https://api.github.com/users/ericsciple/repos","events_url":"https://api.github.com/users/ericsciple/events{/privacy}","received_events_url":"https://api.github.com/users/ericsciple/received_events","type":"User","site_admin":false},"created_at":"2018-07-07T07:59:33Z","updated_at":"2018-07-07T07:59:33Z","author_association":"MEMBER","body":"@4c74356b41 thanks I was able to reproduce the issue. I did not expect this behavior:\r\n\r\n> if I edit the working definition (so the one with resources approved already) to use the templated approach - it breaks\r\n\r\nThanks I was able to reproduce the issue. As a workaround I specified the guid instead of the endpoint name. I'll look into why referencing the endpoint by name isn't working."}}
{"actor":{"display_login":"ericsciple"}}