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

Doesn't handle other Azure Clouds #55

Closed
andrewholler opened this issue Sep 16, 2019 · 5 comments
Closed

Doesn't handle other Azure Clouds #55

andrewholler opened this issue Sep 16, 2019 · 5 comments

Comments

@andrewholler
Copy link
Contributor

andrewholler commented Sep 16, 2019

Re-opening #38. Extension does not work for Azure China or other Azure clouds. ResourceManagementClient is making calls to https://management.azure.com/ baseUri by default. Made changes and tested with private extension in personal DevOps org. See PR #54 referenced below.

@andrewholler
Copy link
Contributor Author

2019-09-16T14:56:09.8663413Z ##[section]Starting: Key Vault ARM Outputs
2019-09-16T14:56:09.8773862Z ==============================================================================
2019-09-16T14:56:09.8774007Z Task : ARM Outputs
2019-09-16T14:56:09.8774142Z Description : This task reads the output values of an ARM deployment and sets them as Azure Pipelines variables.
2019-09-16T14:56:09.8774279Z Version : 5.1.20
2019-09-16T14:56:09.8774380Z Author : Kees Schollaart
2019-09-16T14:56:09.8774504Z Help : More Information
2019-09-16T14:56:09.8774628Z ==============================================================================
2019-09-16T14:56:10.7668431Z 3476db11-5502-4551-bf39-932780b438a5 exists true
2019-09-16T14:56:10.7676403Z Logging in using ApplicationTokenCredentials, authScheme is 'ServicePrincipal'
2019-09-16T14:56:11.9892305Z Unhandled exception during ARM Outputs Task { Error: The subscription 'xxx' could not be found.
2019-09-16T14:56:11.9893683Z at client.pipeline.error (webpack://arm-outputs/./node_modules/azure-arm-resource/lib/resource/operations/deployments.js?:2542:19)
2019-09-16T14:56:11.9894058Z at retryCallback (webpack://arm-outputs/./node_modules/ms-rest/lib/filters/systemErrorRetryPolicyFilter.js?:89:9)
2019-09-16T14:56:11.9894354Z at retryCallback (webpack://arm-outputs/./node_modules/ms-rest/lib/filters/exponentialRetryPolicyFilter.js?:140:9)
2019-09-16T14:56:11.9894646Z at eval (webpack://arm-outputs/./node_modules/ms-rest/lib/filters/rpRegistrationFilter.js?:59:14)
2019-09-16T14:56:11.9895285Z at handleRedirect (webpack://arm-outputs/./node_modules/ms-rest/lib/filters/redirectFilter.js?:39:9)
2019-09-16T14:56:11.9895564Z at eval (webpack://arm-outputs/./node_modules/ms-rest/lib/filters/formDataFilter.js?:23:14)
2019-09-16T14:56:11.9895835Z at Request.defaultRequest [as _callback] (webpack://arm-outputs/./node_modules/ms-rest/lib/requestPipeline.js?:125:16)
2019-09-16T14:56:11.9896117Z at Request.self.callback (webpack://arm-outputs/./node_modules/request/request.js?:185:22)
2019-09-16T14:56:11.9896325Z at emitTwo (events.js:106:13)
2019-09-16T14:56:11.9896532Z at Request.emit (events.js:191:7)
2019-09-16T14:56:11.9896731Z statusCode: 404,
2019-09-16T14:56:11.9896903Z request:
2019-09-16T14:56:11.9897414Z { rawResponse: false,
2019-09-16T14:56:11.9897614Z queryString: {},
2019-09-16T14:56:11.9897872Z url: 'https://management.azure.com/subscriptions/xxx/resourcegroups/xxx/providers/Microsoft.Resources/deployments/?api-version=2018-05-01',
2019-09-16T14:56:11.9898241Z method: 'GET',
2019-09-16T14:56:11.9898430Z headers:
2019-09-16T14:56:11.9898642Z { 'Content-Type': 'application/json; charset=utf-8',
2019-09-16T14:56:11.9898853Z 'x-ms-client-request-id': '5d472757-9eab-49be-836f-9f2ccaad3014',
2019-09-16T14:56:11.9899065Z 'accept-language': 'en-US',
2019-09-16T14:56:11.9899320Z 'user-agent': 'Node/v6.10.3 (x64-Windows_NT-10.0.14393) ms-rest/2.5.3 ms-rest-azure/2.6.0 NO_NAME/0.0.0 Azure-SDK-For-Node' },
2019-09-16T14:56:11.9899541Z body: null },
2019-09-16T14:56:11.9899711Z response:
2019-09-16T14:56:11.9899949Z { body: '{"error":{"code":"SubscriptionNotFound","message":"The subscription 'xxx' could not be found."}}',
2019-09-16T14:56:11.9900183Z headers:
2019-09-16T14:56:11.9900361Z { 'cache-control': 'no-cache',
2019-09-16T14:56:11.9900555Z pragma: 'no-cache',
2019-09-16T14:56:11.9900760Z 'content-type': 'application/json; charset=utf-8',
2019-09-16T14:56:11.9900945Z expires: '-1',
2019-09-16T14:56:11.9901141Z 'x-ms-failure-cause': 'gateway',
2019-09-16T14:56:11.9901360Z 'x-ms-request-id': '6ed97ace-58c6-4707-9936-ea7de3137f05',
2019-09-16T14:56:11.9901589Z 'x-ms-correlation-request-id': '6ed97ace-58c6-4707-9936-ea7de3137f05',
2019-09-16T14:56:11.9903791Z 'x-ms-routing-request-id': 'EASTUS:20190916T145611Z:6ed97ace-58c6-4707-9936-ea7de3137f05',
2019-09-16T14:56:11.9904076Z 'strict-transport-security': 'max-age=31536000; includeSubDomains',
2019-09-16T14:56:11.9904313Z 'x-content-type-options': 'nosniff',
2019-09-16T14:56:11.9904525Z date: 'Mon, 16 Sep 2019 14:56:11 GMT',
2019-09-16T14:56:11.9904730Z connection: 'close',
2019-09-16T14:56:11.9904933Z 'content-length': '129' },
2019-09-16T14:56:11.9905129Z statusCode: 404 },
2019-09-16T14:56:11.9905546Z code: 'SubscriptionNotFound',
2019-09-16T14:56:11.9905831Z body:
2019-09-16T14:56:11.9906034Z { code: 'SubscriptionNotFound',
2019-09-16T14:56:11.9906252Z message: 'The subscription 'xxx' could not be found.' } }
2019-09-16T14:56:12.0018394Z ##[error]Error: The subscription 'xxx' could not be found.
2019-09-16T14:56:12.4334912Z ##[section]Finishing: Key Vault ARM Outputs

@wahidsaleemi
Copy link

Adding some more logs:

2019-09-26T16:26:12.6846560Z Logging in using ApplicationTokenCredentials, authScheme is 'ServicePrincipal'
2019-09-26T16:26:24.2445598Z ApplicationInsights:CorrelationIdManager [ { Error: getaddrinfo ENOTFOUND dc.services.visualstudio.com dc.services.visualstudio.com:443
2019-09-26T16:26:24.2446526Z at errnoException (dns.js:28:10)
2019-09-26T16:26:24.2446871Z at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
2019-09-26T16:26:24.2447162Z code: 'ENOTFOUND',
2019-09-26T16:26:24.2447449Z errno: 'ENOTFOUND',
2019-09-26T16:26:24.2447856Z syscall: 'getaddrinfo',
2019-09-26T16:26:24.2448122Z hostname: 'dc.services.visualstudio.com',
2019-09-26T16:26:24.2448376Z host: 'dc.services.visualstudio.com',
2019-09-26T16:26:24.2448656Z port: 443 } ]
2019-09-26T16:26:34.2142053Z Unhandled exception during ARM Outputs Task { Error: getaddrinfo ENOTFOUND management.azure.com management.azure.com:443
2019-09-26T16:26:34.2142843Z at errnoException (dns.js:28:10)
2019-09-26T16:26:34.2143986Z at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
2019-09-26T16:26:34.2144532Z code: 'ENOTFOUND',
2019-09-26T16:26:34.2144986Z errno: 'ENOTFOUND',
2019-09-26T16:26:34.2145308Z syscall: 'getaddrinfo',
2019-09-26T16:26:34.2145559Z hostname: 'management.azure.com',
2019-09-26T16:26:34.2145824Z host: 'management.azure.com',
2019-09-26T16:26:34.2146234Z port: 443 }
2019-09-26T16:26:34.2297314Z ##[error]Error: getaddrinfo ENOTFOUND management.azure.com management.azure.com:443

If you're using some kind of detection on where Azure DevOps is hosted, the service is always hosted in Commercial (versus Azure US Government). I don't know about China, though. However, the correct cloud/resourcemanagerurl should be available via the Service Connection/context.

@weherdh
Copy link

weherdh commented Oct 25, 2019

I also encounter this issue when deploying resources in China Azure. Hope we can fix this issue.
/assign @keesschollaart81

@keesschollaart81
Copy link
Owner

Closed with #75

@andrewholler
Copy link
Contributor Author

Update 5.3 has so far proven successful in using the ARM Outputs extension with the Azure China environment service connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants