fix(fx-core): harden Azure zip deploy endpoint error handling#15348
Open
EmilioAK wants to merge 1 commit intoOfficeDev:devfrom
Open
fix(fx-core): harden Azure zip deploy endpoint error handling#15348EmilioAK wants to merge 1 commit intoOfficeDev:devfrom
EmilioAK wants to merge 1 commit intoOfficeDev:devfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change hardens
AzureZipDeployImpl.getZipDeployEndpointso deploy failures return actionable errors instead of crashing on malformed/failed ARM responses.Problem
When the App Service details API returned a non-success or unexpected payload, we accessed
responseData.properties.enabledHostNamesdirectly and could crash with:TypeError: Cannot read properties of undefined (reading 'enabledHostNames')That hid the real root cause (for example
403 AuthorizationFailed).Changes
response.okbefore assuming success payload shape.{ error: { code, message } }) even if status is 2xx.properties.enabledHostNamesis a string array.GetZipDeployEndpointErrorfor endpoint-resolution failures.GetZipDeployEndpointErrorin:package.nls.jsonpackage.nls.zh-cn.jsonAzureDeployImpl.test.tsfor:errorpayloadenabledHostNamespayloadValidation
NODE_OPTIONS="--no-experimental-strip-types" pnpm --filter @microsoft/teamsfx-core exec mocha "tests/component/driver/deploy/azure/AzureDeployImpl.test.ts"17 passingNODE_OPTIONS="--no-experimental-strip-types" pnpm --filter @microsoft/teamsfx-core exec mocha "tests/component/driver/deploy/azure/AzureDeployImpl.test.ts" --grep "Get zip deploy endpoint$"1 passingGetZipDeployEndpointError(including403 AuthorizationFailed) instead ofTypeError.Additional Notes