azure-pipelines-tasks: VSTS gives FailedToUpdateApplicationInsightsResource code 201 on deploy Azure App Service

Environment

  • Server - VSTS

Issue Description

We are seeing a warning from app deploys originating with an Application Insights release annotation update. From the code in azure-arm-rest/azure-arm-appinsights.ts, the update method expects a 200 status code response and the documentation at https://docs.microsoft.com/en-us/rest/api/application-insights/components/createorupdate indicates that would be what is returned. However, we are getting a 201 status code which results in an error that AzureClient.ts emits with getFormattedError as ā€œ(CODE ${error.statusCode})ā€:

public getFormattedError(error: any): string {
        if(error && error.message) {
            if(error.statusCode) {
                var errorMessage = typeof error.message.valueOf() == 'string' ? error.message 
                    : (error.message.Code || error.message.code) + " - " + (error.message.Message || error.message.message)
                error.message = `${errorMessage} (CODE: ${error.statusCode})`
            }

            return error.message;
        }

        return error;
    }

Error logs

2018-08-13T21:04:47.6668592Z Successfully deployed web package to App Service. 2018-08-13T21:04:50.2459456Z ##[warning]Can't find loc string for key: FailedToUpdateApplicationInsightsResource 2018-08-13T21:04:50.2464136Z Failed to add release annotation. Error: FailedToUpdateApplicationInsightsResource relode-apps undefined - undefined (CODE: 201) 2018-08-13T21:04:53.3416677Z Successfully updated deployment History at https://relode-api-staging.scm.azurewebsites.net/api/deployments/17861534194290237 2018-08-13T21:04:53.3510848Z ##[section]Finishing: Deploy API

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 29 (7 by maintainers)

Most upvoted comments

Iā€™m seeing the same warnings when using VSTS to deploy Function Apps:

2018-08-17T09:46:46.3005386Z ##[warning]Can't find loc string for key: FailedToUpdateApplicationInsightsResource 2018-08-17T09:46:46.3021074Z Failed to add release annotation. Error: FailedToUpdateApplicationInsightsResource <my_app_name> undefined - undefined (CODE: 201)