Azure-pipelines-tasks: Swap Slots Error: Bad Request

Created on 5 Oct 2017  路  54Comments  路  Source: microsoft/azure-pipelines-tasks

I'm seeing intermittent errors when trying to swap slots via VSTS. It has now become the majority of the time that it fails. I have tried starting the slot first and not starting at all prior to swap. I notice it hangs for quite a while prior to failing with Bad Request. It looks like it took about 7 minutes to fail.

2017-10-05T13:25:09.0042022Z ##[section]Starting: Swap Slots:
2017-10-05T13:25:09.0042022Z ==============================================================================
2017-10-05T13:25:09.0042022Z Task : Azure App Service Manage
2017-10-05T13:25:09.0042022Z Description : Start, Stop, Restart, Slot swap or Install site extensions for an Azure App Service
2017-10-05T13:25:09.0042022Z Version : 0.2.16
2017-10-05T13:25:09.0042022Z Author : Microsoft Corporation
2017-10-05T13:25:09.0042022Z Help : More Information
2017-10-05T13:25:09.0042022Z ==============================================================================
2017-10-05T13:25:10.2854735Z Requesting swap slot for Web App :
2017-10-05T13:32:54.1421377Z Successfully updated deployment History at https://-staging.scm.azurewebsites.net/deployments/
2017-10-05T13:32:57.2985016Z Successfully updated deployment History at https://.scm.azurewebsites.net/deployments/
2017-10-05T13:32:57.2985016Z ##[error]Error: Failed to swap slots for Azure Web App: . Error: Bad Request
2017-10-05T13:32:57.3141112Z ##[section]Finishing: Swap Slots:

AzureAppService Release enhancement

Most helpful comment

I am also having this issue with Github deployment. Was working fine for a number of swaps now getting

statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"BadRequest\",\"message\":\"Cannot swap slots for site 'XXX' because the worker process for 'XXX' slot could not be started.\"}]}}"

Don't have an appsetting for WEBSITE_LOCAL_CACHE_OPTION

Any help would be appreciated.

All 54 comments

Can you queue a new build and set the system.debug variable to true? This should output more information about what exactly is failing.

Here is the debug for that step:

Evaluating condition for step: 'Swap Slots: '
Evaluating: succeeded()
Evaluating succeeded:
=> (Boolean) True
Expanded: True
Result: True


Starting: Swap Slots:

**************************

Task : Azure App Service Manage
Description : Start, Stop, Restart, Slot swap or Install site extensions for an Azure App Service
Version : 0.2.16
Author : Microsoft Corporation

Help : More Information

agent.workFolder=C:\BuildAgents\DefaultPool_work
loading inputs and endpoints
loading ENDPOINT_AUTH_
loading ENDPOINT_AUTH_PARAMETER__SERVICEPRINCIPALID
loading ENDPOINT_AUTH_PARAMETER__SERVICEPRINCIPALKEY
loading ENDPOINT_AUTH_PARAMETER__TENANTID
loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
loading ENDPOINT_AUTH_SCHEME_
loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
loading INPUT_ACTION
loading INPUT_CONNECTEDSERVICENAME
loading INPUT_PRESERVEVNET
loading INPUT_RESOURCEGROUPNAME
loading INPUT_SOURCESLOT
loading INPUT_SPECIFYSLOT
loading INPUT_SWAPWITHPRODUCTION
loading INPUT_WEBAPPNAME
loaded 16
AZURE_HTTP_USER_AGENT=VSTS__build_29_2659
AZURE_HTTP_USER_AGENT=VSTS__build_29_2659
AZURE_HTTP_USER_AGENT=VSTS__build_29_2659
check path : C:\BuildAgents\DefaultPool_work_tasks\AzureAppServiceManage_\0.2.16\task.json
set resource file to: C:\BuildAgents\DefaultPool_work_tasks\AzureAppServiceManage_\0.2.16\task.json
system.culture=en-US
ConnectedServiceName=
Action=Swap Slots
WebAppName=
ResourceGroupName=DevResourceGroup
SpecifySlot=false
Slot=null
SourceSlot=staging
SwapWithProduction=true
TargetSlot=null
PreserveVnet=false
ExtensionsList=null
OutputVariable=null
data subscriptionid =
auth param serviceprincipalid = *
auth param serviceprincipalkey =
*
auth param tenantid = *
data subscriptionid =
data environmentAuthorityUrl = https://login.windows.net/
=https://management.azure.com/
data environment = AzureCloud
data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Requesting swap slot for Web App :
Monitoring slot swap operation status from: https://management.azure.com/subscriptions//resourceGroups/DevResourceGroup/providers/Microsoft.Web/sites//slots/staging/operationresults/?api-version=2016-08-01
Slot swap operation is in progress. Attempt : 1
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 2
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 3
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 4
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 5
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 6
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 7
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 8
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 9
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 10
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 11
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 12
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 13
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 14
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 15
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 16
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 17
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 18
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 19
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 20
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 21
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 22
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 23
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 24
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 25
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 26
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 27
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 28
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 29
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 30
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 31
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 32
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 33
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 34
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 35
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 36
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 37
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 38
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 39
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 40
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 41
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 42
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 43
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 44
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 45
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 46
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 47
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 48
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 49
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 50
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 51
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 52
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 53
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 54
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 55
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 56
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 57
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 58
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 59
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 60
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 61
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 62
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 63
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 64
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 65
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 66
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 67
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 68
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 69
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 70
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 71
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 72
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 73
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 74
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 75
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 76
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 77
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 78
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation is in progress. Attempt : 79
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Slot swap operation is in progress. Attempt : 80
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Slot swap operation failed. Operation Response: {"Code":"BadRequest","Message":"Cannot swap slots for site '' because the application initialization in 'staging' slot either took too long or failed. Please check AppInit module configuration or try using swap with preview if application initialization time is very long.","Target":null,"Details":[{"Message":"Cannot swap slots for site '' because the application initialization in 'staging' slot either took too long or failed. Please check AppInit module configuration or try using swap with preview if application initialization time is very long."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"04903","MessageTemplate":"Cannot swap slots for site '{0}' because the application initialization in '{1}' slot either took too long or failed. Please check AppInit module configuration or try using swap with preview if application initialization time is very long.","Parameters":[],"InnerErrors":[],"Code":"BadRequest","Message":"Cann...
build.buildUri=vstfs:///Build/Build/2659
release.releaseUri=undefined
build.buildId=2659
release.releaseId=undefined
Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
Requesting Azure Publish Profile: https://management.azure.com/subscriptions//resourceGroups/DevResourceGroup/providers/Microsoft.Web/sites//slots/staging/publishxml?api-version=2016-08-01
Web App Publish Kudu URL: -staging.scm.azurewebsites.net:443
build.sourceVersionAuthor=Nico Lindsey
build.buildUri=vstfs:///Build/Build/2659
release.releaseUri=undefined
build.buildId=2659
release.releaseId=undefined
build.buildNumber=1.171.1005.2659
release.releaseName=undefined
system.TeamFoundationCollectionUri=https://.visualstudio.com/
system.teamProjectId=
build.sourceVersion=
build.repository.name=epi
build.repository.provider=TfsGit
Successfully updated deployment History at https://-staging.scm.azurewebsites.net/deployments/
Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
Requesting Azure Publish Profile: https://management.azure.com/subscriptions//resourceGroups/DevResourceGroup/providers/Microsoft.Web/sites//publishxml?api-version=2016-08-01
Web App Publish Kudu URL: .scm.azurewebsites.net:443
build.sourceVersionAuthor=Nico Lindsey
build.buildUri=vstfs:///Build/Build/2659
release.releaseUri=undefined
build.buildId=2659
release.releaseId=undefined
build.buildNumber=1.171.1005.2659
release.releaseName=undefined
system.TeamFoundationCollectionUri=https://.visualstudio.com/
system.teamProjectId=
build.sourceVersion=
build.repository.name=epi
build.repository.provider=TfsGit
Successfully updated deployment History at https://.scm.azurewebsites.net/deployments/
task result: Failed
Error: Failed to swap slots for Azure Web App: . Error: Bad Request
Processed: ##vso[task.issue type=error;]Error: Failed to swap slots for Azure Web App: . Error: Bad Request
Processed: ##vso[task.complete result=Failed;]Error: Failed to swap slots for Azure Web App: . Error: Bad Request

we are experiencing the exact same issue as the log above. doesn't seem to be getting a valid auth token.

I opened a ticket with Microsoft also. They instructed that the website was not started, even though i called a start app service step. I added a powershell command of Invoke-WebRequest to both the staging and production slots prior to swap slots and it fixed my issue.

What i'm seeing is that if swap slots is called prior to the Invoke-WebRequest, my apps will fail to load indefinitely. If i call Invoke-WebRequest prior, then the swap slots work correctly.

@rhessinger Is this Linux or Windows web app ? Also, are you using any slot specific settings for your app ? It looks like application initialization is taking long due to which the task could not verify whether swap actually happened. Using Invoke-WebRequest before the swap operation will ensure that web app is warmed up and ready to process further requests. You can continue using this fix while we investigate further.

This is a Windows .net 4.5.2 web app. We are not using any slot specific settings. I also wanted to point out that the Invoke-Web Request took 10 seconds to initialize. After that, the swap slot worked. If I ran the swap slot without the invoke, the web app would refuse to start (hang) until the timeout expired.

Not sure if this is related, but I experienced the same issue as described. The problem occurred on Friday and has continued until today. I attempted to go to the url for the staging app, but page responded with server error. I restarted my staging app in azure. And the page now loads successfully, meaning i can deploy aswell.
So Im guessing this is more of an azure issue ?

Getting occasional, very annoying, non informative errors that fail my builds randomly. "Failed to swap slots for Azure Web App. Error: Bad Request". Any workarounds to this? I didnt encounter random failures with the "old" task

@knuterik91 I notice when the swap slot happens without the site warmed up, it will lock the initialize of your app until you restart the app. Once both slots are warmed up, swap slot seems to work fine.

@RobertHamiltonPeople Try warming up both slots using powershell to call Invoke-WebRequest prior to calling swap slots. Seems to work for me every time. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1

@rhessinger Yeah, you are right. Again I have the same problem.

Just to confirm your workaround. I have created a inline PS script before i do my slot swapping.
Is this script sufficient :
Invoke-WebRequest -URI https://myslotwebsiteurl.azurewebsites.net/ -usebasicparsing

@knuterik91 That should work. I have been using a more basic usage Invoke-WebRequest https://myslotwebsiteurl.azurewebsites.net/ I would call it on your production slot also, just to make sure that is warmed up prior also.

One that that could be related to this issue is that we have noticed that our Http Queue Length and our Disk Queue Length tend to sky rocket when we deploy and swap slots. After a few deployments to the same app service causes these numbers to go in to the thousands. This happens in our test environment which has very little user load (1 or 2 concurrent users), but we do deploy to it often. When these numbers go up the slots will not swap and our services do not respond to requests.

@rsnj , apologies for late response.
Can you please share the debug logs (set system.debug = true and re-run the release) for the release?

@vincentdass here you go:

2017-11-16T15:59:56.3095210Z ##[debug]Evaluating condition for step: 'Swap Slots: MySite-Development'
2017-11-16T15:59:56.3095210Z ##[debug]Evaluating: succeeded()
2017-11-16T15:59:56.3095210Z ##[debug]Evaluating succeeded:
2017-11-16T15:59:56.3095210Z ##[debug]=> (Boolean) True
2017-11-16T15:59:56.3095210Z ##[debug]Expanded: True
2017-11-16T15:59:56.3095210Z ##[debug]Result: True
2017-11-16T15:59:56.3095210Z ##[section]Starting: Swap Slots: MySite-Development
2017-11-16T15:59:56.3095210Z ==============================================================================
2017-11-16T15:59:56.3095210Z Task : Azure App Service Manage
2017-11-16T15:59:56.3095210Z Description : Start, Stop, Restart, Slot swap or Install site extensions for an Azure App Service
2017-11-16T15:59:56.3095210Z Version : 0.2.19
2017-11-16T15:59:56.3095210Z Author : Microsoft Corporation
2017-11-16T15:59:56.3095210Z Help : More Information
2017-11-16T15:59:56.3095210Z ==============================================================================
2017-11-16T15:59:56.5282810Z ##[debug]agent.workFolder=C:\agent_work
2017-11-16T15:59:56.5282810Z ##[debug]loading inputs and endpoints
2017-11-16T15:59:56.5282810Z ##[debug]loading ENDPOINT_AUTH_XXXXXXXXX
2017-11-16T15:59:56.5282810Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_XXXXXXXXX_SERVICEPRINCIPALID
2017-11-16T15:59:56.5282810Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_XXXXXXXXX_SERVICEPRINCIPALKEY
2017-11-16T15:59:56.5282810Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_XXXXXXXXX_TENANTID
2017-11-16T15:59:56.5439059Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2017-11-16T15:59:56.5439059Z ##[debug]loading ENDPOINT_AUTH_SCHEME_XXXXXXXXX
2017-11-16T15:59:56.5439059Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2017-11-16T15:59:56.5439059Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_ACTION
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_CONNECTEDSERVICENAME
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_PRESERVEVNET
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_RESOURCEGROUPNAME
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_SLOT
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_SOURCESLOT
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_SPECIFYSLOT
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_SWAPWITHPRODUCTION
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_TARGETSLOT
2017-11-16T15:59:56.5439059Z ##[debug]loading INPUT_WEBAPPNAME
2017-11-16T15:59:56.5439059Z ##[debug]loading SECRET_WEBSITEPASSWORD
2017-11-16T15:59:56.5439059Z ##[debug]loading SECRET_WEBSITEUSERNAME
2017-11-16T15:59:56.5439059Z ##[debug]loaded 20
2017-11-16T15:59:56.6220459Z ##[debug]agent.proxyurl=undefined
2017-11-16T15:59:56.6220459Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_XXXXXXXXX_release_2_2815_5360_2
2017-11-16T15:59:56.6220459Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_XXXXXXXXX_release_2_2815_5360_2
2017-11-16T15:59:56.6376596Z ##[debug]agent.proxyurl=undefined
2017-11-16T15:59:56.6376596Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_XXXXXXXXX_release_2_2815_5360_2
2017-11-16T15:59:56.6376596Z ##[debug]agent.proxyurl=undefined
2017-11-16T15:59:56.6376596Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_XXXXXXXXX_release_2_2815_5360_2
2017-11-16T15:59:56.6376596Z ##[debug]check path : C:\agent_work_tasks\AzureAppServiceManage_XXXXXXXXX\0.2.19\task.json
2017-11-16T15:59:56.6376596Z ##[debug]set resource file to: C:\agent_work_tasks\AzureAppServiceManage_XXXXXXXXX\0.2.19\task.json
2017-11-16T15:59:56.6376596Z ##[debug]system.culture=en-US
2017-11-16T15:59:56.6532856Z ##[debug]ConnectedServiceName=XXXXXXXXX
2017-11-16T15:59:56.6532856Z ##[debug]Action=Swap Slots
2017-11-16T15:59:56.6532856Z ##[debug]WebAppName=MySite-Development
2017-11-16T15:59:56.6532856Z ##[debug]ResourceGroupName=MySite-Development
2017-11-16T15:59:56.6532856Z ##[debug]SpecifySlot=false
2017-11-16T15:59:56.6532856Z ##[debug]Slot=Staging
2017-11-16T15:59:56.6532856Z ##[debug]AppInsightsResourceGroupName=null
2017-11-16T15:59:56.6532856Z ##[debug]ApplicationInsightsResourceName=null
2017-11-16T15:59:56.6532856Z ##[debug]SourceSlot=Staging
2017-11-16T15:59:56.6532856Z ##[debug]SwapWithProduction=true
2017-11-16T15:59:56.6532856Z ##[debug]TargetSlot=Staging
2017-11-16T15:59:56.6532856Z ##[debug]PreserveVnet=false
2017-11-16T15:59:56.6532856Z ##[debug]ExtensionsList=null
2017-11-16T15:59:56.6532856Z ##[debug]OutputVariable=null
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX data subscriptionid = XXXXXXXXX
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX auth param serviceprincipalid = *
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX auth param serviceprincipalkey =
*
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX auth param tenantid = *
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX data subscriptionid = XXXXXXXXX
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX data environmentAuthorityUrl = https://login.windows.net/
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX=https://management.azure.com/
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX data environment = AzureCloud
2017-11-16T15:59:56.6532856Z ##[debug]XXXXXXXXX data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/
2017-11-16T15:59:56.6532856Z ##[debug]Set swap with production to true as target is production
2017-11-16T15:59:56.6532856Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T15:59:56.8251675Z Requesting swap slot for Web App : MySite-Development
2017-11-16T15:59:57.7936934Z ##[debug]Monitoring slot swap operation status from: https://management.azure.com/subscriptions/XXXXXXXXX/resourceGroups/MySite-Development/providers/Microsoft.Web/sites/MySite-Development/slots/staging/operationresults/8cbed159-1cd7-49f7-91fd-cc70dbc21ddd?api-version=2016-08-01
2017-11-16T15:59:57.7936934Z ##[debug]Slot swap operation is in progress. Attempt : 1
2017-11-16T15:59:57.7936934Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:00:03.3302853Z ##[debug]Slot swap operation is in progress. Attempt : 2
2017-11-16T16:00:03.3302853Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:00:08.6994467Z ##[debug]Slot swap operation is in progress. Attempt : 3
2017-11-16T16:00:08.6994467Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:00:14.2571267Z ##[debug]Slot swap operation is in progress. Attempt : 4
2017-11-16T16:00:14.2571267Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:00:19.5733398Z ##[debug]Slot swap operation is in progress. Attempt : 5
2017-11-16T16:00:19.5733398Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:00:24.9475027Z ##[debug]Slot swap operation is in progress. Attempt : 6
2017-11-16T16:00:24.9475027Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:00:30.9609557Z ##[debug]Slot swap operation is in progress. Attempt : 7
2017-11-16T16:00:30.9609557Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:00:36.3043531Z ##[debug]Slot swap operation is in progress. Attempt : 8
2017-11-16T16:00:36.3043531Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:00:44.4887063Z ##[debug]Slot swap operation is in progress. Attempt : 9
2017-11-16T16:00:44.4887063Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:00:49.8890736Z ##[debug]Slot swap operation is in progress. Attempt : 10
2017-11-16T16:00:49.8890736Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:00:55.2370661Z ##[debug]Slot swap operation is in progress. Attempt : 11
2017-11-16T16:00:55.2370661Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:01:00.8577626Z ##[debug]Slot swap operation is in progress. Attempt : 12
2017-11-16T16:01:00.8577626Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:01:06.3050616Z ##[debug]Slot swap operation is in progress. Attempt : 13
2017-11-16T16:01:06.3050616Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:01:12.1143986Z ##[debug]Slot swap operation is in progress. Attempt : 14
2017-11-16T16:01:12.1143986Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:01:17.4935820Z ##[debug]Slot swap operation is in progress. Attempt : 15
2017-11-16T16:01:17.4935820Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:01:22.9473669Z ##[debug]Slot swap operation is in progress. Attempt : 16
2017-11-16T16:01:22.9473669Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:01:28.3334151Z ##[debug]Slot swap operation is in progress. Attempt : 17
2017-11-16T16:01:28.3334151Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:01:33.7215476Z ##[debug]Slot swap operation is in progress. Attempt : 18
2017-11-16T16:01:33.7215476Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:01:39.0730966Z ##[debug]Slot swap operation is in progress. Attempt : 19
2017-11-16T16:01:39.0730966Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:01:44.8894378Z ##[debug]Slot swap operation is in progress. Attempt : 20
2017-11-16T16:01:44.8894378Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:01:51.1811560Z ##[debug]Slot swap operation is in progress. Attempt : 21
2017-11-16T16:01:51.1811560Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:01:56.5240112Z ##[debug]Slot swap operation is in progress. Attempt : 22
2017-11-16T16:01:56.5240112Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:02:01.9290234Z ##[debug]Slot swap operation is in progress. Attempt : 23
2017-11-16T16:02:01.9290234Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:02:07.2663640Z ##[debug]Slot swap operation is in progress. Attempt : 24
2017-11-16T16:02:07.2663640Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:02:12.7252096Z ##[debug]Slot swap operation is in progress. Attempt : 25
2017-11-16T16:02:12.7252096Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:02:18.0676722Z ##[debug]Slot swap operation is in progress. Attempt : 26
2017-11-16T16:02:18.0676722Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:02:23.6468185Z ##[debug]Slot swap operation is in progress. Attempt : 27
2017-11-16T16:02:23.6468185Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:02:28.9788567Z ##[debug]Slot swap operation is in progress. Attempt : 28
2017-11-16T16:02:28.9788567Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:02:34.2940622Z ##[debug]Slot swap operation is in progress. Attempt : 29
2017-11-16T16:02:34.2940622Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:02:39.6486881Z ##[debug]Slot swap operation is in progress. Attempt : 30
2017-11-16T16:02:39.6486881Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:02:44.9756258Z ##[debug]Slot swap operation is in progress. Attempt : 31
2017-11-16T16:02:44.9756258Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:02:50.4440727Z ##[debug]Slot swap operation is in progress. Attempt : 32
2017-11-16T16:02:50.4440727Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:02:56.1066347Z ##[debug]Slot swap operation is in progress. Attempt : 33
2017-11-16T16:02:56.1066347Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:03:01.5221517Z ##[debug]Slot swap operation is in progress. Attempt : 34
2017-11-16T16:03:01.5221517Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:03:06.9593644Z ##[debug]Slot swap operation is in progress. Attempt : 35
2017-11-16T16:03:06.9593644Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:03:12.3657756Z ##[debug]Slot swap operation is in progress. Attempt : 36
2017-11-16T16:03:12.3657756Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:03:17.8185960Z ##[debug]Slot swap operation is in progress. Attempt : 37
2017-11-16T16:03:17.8185960Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:03:23.2164404Z ##[debug]Slot swap operation is in progress. Attempt : 38
2017-11-16T16:03:23.2164404Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:03:28.5563939Z ##[debug]Slot swap operation is in progress. Attempt : 39
2017-11-16T16:03:28.5563939Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:03:34.0979645Z ##[debug]Slot swap operation is in progress. Attempt : 40
2017-11-16T16:03:34.0979645Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:03:39.6669725Z ##[debug]Slot swap operation is in progress. Attempt : 41
2017-11-16T16:03:39.6669725Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:03:45.1403612Z ##[debug]Slot swap operation is in progress. Attempt : 42
2017-11-16T16:03:45.1403612Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:03:50.4405249Z ##[debug]Slot swap operation is in progress. Attempt : 43
2017-11-16T16:03:50.4405249Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:03:56.2759985Z ##[debug]Slot swap operation is in progress. Attempt : 44
2017-11-16T16:03:56.2759985Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:04:01.6249526Z ##[debug]Slot swap operation is in progress. Attempt : 45
2017-11-16T16:04:01.6249526Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:04:06.9935558Z ##[debug]Slot swap operation is in progress. Attempt : 46
2017-11-16T16:04:06.9935558Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:04:12.3470898Z ##[debug]Slot swap operation is in progress. Attempt : 47
2017-11-16T16:04:12.3470898Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:04:17.7051211Z ##[debug]Slot swap operation is in progress. Attempt : 48
2017-11-16T16:04:17.7051211Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:04:23.0470137Z ##[debug]Slot swap operation is in progress. Attempt : 49
2017-11-16T16:04:23.0470137Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:04:28.4534707Z ##[debug]Slot swap operation is in progress. Attempt : 50
2017-11-16T16:04:28.4534707Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:04:33.7858114Z ##[debug]Slot swap operation is in progress. Attempt : 51
2017-11-16T16:04:33.7858114Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:04:39.3959284Z ##[debug]Slot swap operation is in progress. Attempt : 52
2017-11-16T16:04:39.3959284Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:04:44.8593562Z ##[debug]Slot swap operation is in progress. Attempt : 53
2017-11-16T16:04:44.8593562Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:04:50.1916963Z ##[debug]Slot swap operation is in progress. Attempt : 54
2017-11-16T16:04:50.1916963Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:04:55.5709574Z ##[debug]Slot swap operation is in progress. Attempt : 55
2017-11-16T16:04:55.5709574Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:05:00.9714107Z ##[debug]Slot swap operation is in progress. Attempt : 56
2017-11-16T16:05:00.9714107Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:05:07.0588627Z ##[debug]Slot swap operation is in progress. Attempt : 57
2017-11-16T16:05:07.0588627Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:05:12.4119246Z ##[debug]Slot swap operation is in progress. Attempt : 58
2017-11-16T16:05:12.4119246Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:05:18.2161533Z ##[debug]Slot swap operation is in progress. Attempt : 59
2017-11-16T16:05:18.2161533Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:05:23.7097986Z ##[debug]Slot swap operation is in progress. Attempt : 60
2017-11-16T16:05:23.7097986Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:05:30.7416364Z ##[debug]Slot swap operation is in progress. Attempt : 61
2017-11-16T16:05:30.7416364Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:05:36.5508694Z ##[debug]Slot swap operation is in progress. Attempt : 62
2017-11-16T16:05:36.5508694Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:05:42.1241887Z ##[debug]Slot swap operation is in progress. Attempt : 63
2017-11-16T16:05:42.1241887Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:05:47.5547558Z ##[debug]Slot swap operation is in progress. Attempt : 64
2017-11-16T16:05:47.5547558Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:05:52.9457257Z ##[debug]Slot swap operation is in progress. Attempt : 65
2017-11-16T16:05:52.9457257Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:05:58.3467465Z ##[debug]Slot swap operation is in progress. Attempt : 66
2017-11-16T16:05:58.3467465Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:06:04.3713047Z ##[debug]Slot swap operation is in progress. Attempt : 67
2017-11-16T16:06:04.3713047Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:06:09.8497510Z ##[debug]Slot swap operation is in progress. Attempt : 68
2017-11-16T16:06:09.8497510Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:06:15.3555223Z ##[debug]Slot swap operation is in progress. Attempt : 69
2017-11-16T16:06:15.3555223Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:06:20.7246368Z ##[debug]Slot swap operation is in progress. Attempt : 70
2017-11-16T16:06:20.7246368Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:06:26.0671014Z ##[debug]Slot swap operation is in progress. Attempt : 71
2017-11-16T16:06:26.0671014Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:06:31.7548134Z ##[debug]Slot swap operation is in progress. Attempt : 72
2017-11-16T16:06:31.7548134Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:06:37.1240237Z ##[debug]Slot swap operation is in progress. Attempt : 73
2017-11-16T16:06:37.1240237Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:06:42.4467744Z ##[debug]Slot swap operation is in progress. Attempt : 74
2017-11-16T16:06:42.4467744Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:06:47.8734022Z ##[debug]Slot swap operation is in progress. Attempt : 75
2017-11-16T16:06:47.8734022Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:06:53.4637782Z ##[debug]Slot swap operation is in progress. Attempt : 76
2017-11-16T16:06:53.4637782Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:06:58.7997370Z ##[debug]Slot swap operation is in progress. Attempt : 77
2017-11-16T16:06:58.7997370Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:07:04.1315750Z ##[debug]Slot swap operation is in progress. Attempt : 78
2017-11-16T16:07:04.1315750Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:07:09.4909694Z ##[debug]Slot swap operation is in progress. Attempt : 79
2017-11-16T16:07:09.4909694Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:07:14.9540602Z ##[debug]Slot swap operation is in progress. Attempt : 80
2017-11-16T16:07:14.9540602Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:07:20.4013974Z ##[debug]Slot swap operation is in progress. Attempt : 81
2017-11-16T16:07:20.4013974Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:07:25.7745506Z ##[debug]Slot swap operation is in progress. Attempt : 82
2017-11-16T16:07:25.7745506Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:07:31.4436754Z ##[debug]Slot swap operation is in progress. Attempt : 83
2017-11-16T16:07:31.4436754Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:07:36.8491260Z ##[debug]Slot swap operation is in progress. Attempt : 84
2017-11-16T16:07:36.8491260Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:07:42.7002148Z ##[debug]Slot swap operation is in progress. Attempt : 85
2017-11-16T16:07:42.7002148Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:07:48.0487162Z ##[debug]Slot swap operation is in progress. Attempt : 86
2017-11-16T16:07:48.0487162Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:07:53.3597167Z ##[debug]Slot swap operation is in progress. Attempt : 87
2017-11-16T16:07:53.3597167Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:07:58.9176340Z ##[debug]Slot swap operation is in progress. Attempt : 88
2017-11-16T16:07:58.9176340Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:08:04.2232559Z ##[debug]Slot swap operation is in progress. Attempt : 89
2017-11-16T16:08:04.2232559Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:08:09.5717584Z ##[debug]Slot swap operation is in progress. Attempt : 90
2017-11-16T16:08:09.5717584Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:08:14.9035913Z ##[debug]Slot swap operation is in progress. Attempt : 91
2017-11-16T16:08:14.9035913Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:08:20.4194175Z ##[debug]Slot swap operation is in progress. Attempt : 92
2017-11-16T16:08:20.4194175Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:08:25.7674724Z ##[debug]Slot swap operation is in progress. Attempt : 93
2017-11-16T16:08:25.7674724Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:08:31.1154068Z ##[debug]Slot swap operation is in progress. Attempt : 94
2017-11-16T16:08:31.1154068Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:08:36.4477037Z ##[debug]Slot swap operation is in progress. Attempt : 95
2017-11-16T16:08:36.4477037Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:08:41.7735019Z ##[debug]Slot swap operation is in progress. Attempt : 96
2017-11-16T16:08:41.7735019Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:08:47.1698394Z ##[debug]Slot swap operation is in progress. Attempt : 97
2017-11-16T16:08:47.1698394Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:08:52.5228616Z ##[debug]Slot swap operation is in progress. Attempt : 98
2017-11-16T16:08:52.5228616Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:08:57.8396440Z ##[debug]Slot swap operation is in progress. Attempt : 99
2017-11-16T16:08:57.8396440Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:09:03.2294627Z ##[debug]Slot swap operation is in progress. Attempt : 100
2017-11-16T16:09:03.2294627Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:09:08.5881175Z ##[debug]Slot swap operation is in progress. Attempt : 101
2017-11-16T16:09:08.5881175Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:09:13.9255362Z ##[debug]Slot swap operation is in progress. Attempt : 102
2017-11-16T16:09:13.9255362Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:09:19.2300936Z ##[debug]Slot swap operation is in progress. Attempt : 103
2017-11-16T16:09:19.2300936Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:09:24.7045884Z ##[debug]Slot swap operation is in progress. Attempt : 104
2017-11-16T16:09:24.7045884Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:09:30.3470126Z ##[debug]Slot swap operation is in progress. Attempt : 105
2017-11-16T16:09:30.3470126Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:09:35.6888626Z ##[debug]Slot swap operation is in progress. Attempt : 106
2017-11-16T16:09:35.6888626Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:09:41.1734459Z ##[debug]Slot swap operation is in progress. Attempt : 107
2017-11-16T16:09:41.1734459Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:09:46.9928636Z ##[debug]Slot swap operation is in progress. Attempt : 108
2017-11-16T16:09:46.9928636Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:09:52.6351692Z ##[debug]Slot swap operation is in progress. Attempt : 109
2017-11-16T16:09:52.6351692Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:09:57.9625204Z ##[debug]Slot swap operation is in progress. Attempt : 110
2017-11-16T16:09:57.9625204Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:10:03.2842689Z ##[debug]Slot swap operation is in progress. Attempt : 111
2017-11-16T16:10:03.2842689Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:10:09.0552132Z ##[debug]Slot swap operation is in progress. Attempt : 112
2017-11-16T16:10:09.0552132Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:10:14.4360541Z ##[debug]Slot swap operation is in progress. Attempt : 113
2017-11-16T16:10:14.4360541Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:10:19.8370106Z ##[debug]Slot swap operation is in progress. Attempt : 114
2017-11-16T16:10:19.8370106Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:10:20.3842631Z ##[debug]build.buildUri=vstfs:///Build/Build/5050
2017-11-16T16:10:20.3842631Z ##[debug]release.releaseUri=vstfs:///ReleaseManagement/Release/2815
2017-11-16T16:10:20.3842631Z ##[debug]build.buildId=5050
2017-11-16T16:10:20.3842631Z ##[debug]release.releaseId=2815
2017-11-16T16:10:20.3842631Z ##[debug]Requesting for Auth Token: https://login.windows.net/*/oauth2/token/
2017-11-16T16:10:20.5405094Z ##[debug]Requesting Azure Publish Profile: https://management.azure.com/subscriptions/XXXXXXXXX/resourceGroups/MySite-Development/providers/Microsoft.Web/sites/MySite-Development/slots/staging/publishxml?api-version=2016-08-01
2017-11-16T16:10:21.1569751Z ##[debug]Web App Publish Kudu URL: MySite-development-staging.scm.azurewebsites.net:443
2017-11-16T16:10:21.1569751Z ##[debug]build.sourceVersionAuthor=undefined
2017-11-16T16:10:21.1569751Z ##[debug]build.requestedfor=XXXXXX
2017-11-16T16:10:21.1569751Z ##[debug]build.buildUri=vstfs:///Build/Build/5050
2017-11-16T16:10:21.1569751Z ##[debug]release.releaseUri=vstfs:///ReleaseManagement/Release/2815
2017-11-16T16:10:21.1569751Z ##[debug]build.buildId=5050
2017-11-16T16:10:21.1569751Z ##[debug]release.releaseId=2815
2017-11-16T16:10:21.1569751Z ##[debug]build.buildNumber=5050
2017-11-16T16:10:21.1569751Z ##[debug]release.releaseName=Release-487
2017-11-16T16:10:21.1569751Z ##[debug]system.TeamFoundationCollectionUri=https://MySite.visualstudio.com/
2017-11-16T16:10:21.1569751Z ##[debug]system.teamProjectId=XXXXXXXXX
2017-11-16T16:10:21.1569751Z ##[debug]build.sourceVersion=XXXXXX
2017-11-16T16:10:21.1569751Z ##[debug]build.repository.name=MySite
2017-11-16T16:10:21.1569751Z ##[debug]build.repository.provider=TfsGit
2017-11-16T16:10:33.5158721Z Successfully updated deployment History at https://MySite-development-staging.scm.azurewebsites.net/api/deployments/XXXXXXXXX
2017-11-16T16:10:33.5158721Z ##[debug]Requesting for Auth Token: https://login.windows.net/
*/oauth2/token/
2017-11-16T16:10:33.6565088Z ##[debug]Requesting Azure Publish Profile: https://management.azure.com/subscriptions/XXXXXXXXX/resourceGroups/MySite-Development/providers/Microsoft.Web/sites/MySite-Development/publishxml?api-version=2016-08-01
2017-11-16T16:10:33.9925426Z ##[debug]Web App Publish Kudu URL: MySite-development.scm.azurewebsites.net:443
2017-11-16T16:10:33.9925426Z ##[debug]build.sourceVersionAuthor=undefined
2017-11-16T16:10:33.9925426Z ##[debug]build.requestedfor=XXXXXX
2017-11-16T16:10:33.9925426Z ##[debug]build.buildUri=vstfs:///Build/Build/5050
2017-11-16T16:10:33.9925426Z ##[debug]release.releaseUri=vstfs:///ReleaseManagement/Release/2815
2017-11-16T16:10:33.9925426Z ##[debug]build.buildId=5050
2017-11-16T16:10:33.9925426Z ##[debug]release.releaseId=2815
2017-11-16T16:10:33.9925426Z ##[debug]build.buildNumber=5050
2017-11-16T16:10:33.9925426Z ##[debug]release.releaseName=Release-487
2017-11-16T16:10:33.9925426Z ##[debug]system.TeamFoundationCollectionUri=https://MySite.visualstudio.com/
2017-11-16T16:10:33.9925426Z ##[debug]system.teamProjectId=XXXXXXXXX
2017-11-16T16:10:33.9925426Z ##[debug]build.sourceVersion=XXXXXX
2017-11-16T16:10:33.9925426Z ##[debug]build.repository.name=MySite
2017-11-16T16:10:33.9925426Z ##[debug]build.repository.provider=TfsGit
2017-11-16T16:10:38.4893449Z Successfully updated deployment History at https://MySite-development.scm.azurewebsites.net/api/deployments/XXXXXXXXX
2017-11-16T16:10:38.4893449Z ##[debug]task result: Failed
2017-11-16T16:10:38.4893449Z ##[error]Error: Failed to swap slots for Azure Web App: MySite-Development. Error: Error: Failed request: (400)
2017-11-16T16:10:38.4893449Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Failed to swap slots for Azure Web App: MySite-Development. Error: Error: Failed request: (400)
2017-11-16T16:10:38.4893449Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Failed to swap slots for Azure Web App: MySite-Development. Error: Error: Failed request: (400)
2017-11-16T16:10:38.5023986Z ##[section]Finishing: Swap Slots: MySite-Development

Hi,

I'm struggling with almost the same problem just as @rsnj mentioned in this issue. My setup:

  • deployment target: Web app for containers (with a Linux host OS)
  • deployment is performed by a VSTS release definition with an "Azure App Service Manage - Swap slots" built-in step.
  • my service has a slow warmup time (30-60 sec) for the first HTTP request after restart on deployment, so it may cause timeouts at some point if Release def. steps check endpoint availability as they run

As I inspect the results of running the release in debug mode I see the same attempts as VSTS tries to get an OAuth token many-many times. The slot where we deploy to - and try to swap with a "Swap slots" release step returns an HTTP 500 when its root URL is called. This is not an unexpected error, we are prepared for this. I assume this cannot be a problem because in other environments the slot swapping works perfectly, only our production environment is affected. The only difference between Dev and Prod is that they are in different Azure regions.

Thanks for any help in advance. I attach the relevant parts of debug logs from my release definition:


2017-11-16T20:09:36.3773575Z Requesting swap slot for Web App :
2017-11-16T20:09:37.6438729Z ##[debug]Monitoring slot swap operation status from: https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/sites//slots/deploy/operationresults/?api-version=2016-08-01
2017-11-16T20:09:37.6448723Z ##[debug]Slot swap operation is in progress. Attempt : 1
2017-11-16T20:09:37.6448723Z ##[debug]Requesting for Auth Token: https://login.windows.net/**/oauth2/token/
....
....
2017-11-16T20:17:27.7525837Z ##[debug]Re-evaluate condition on job cancellation for step: 'Swap Slots: '.
2017-11-16T20:17:27.7975883Z ##[error]The operation was canceled.
2017-11-16T20:17:27.7995882Z ##[debug]System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at Microsoft.VisualStudio.Services.Agent.ProcessInvoker.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.NodeHandler.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskRunner.d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.d__1.MoveNext()
2017-11-16T20:17:27.7995882Z ##[section]Finishing: Swap Slots:

@rsnj , @gkovacslmi , Thanks for the info and logs.
Is the swap slot failing even with adding warm-up?
Can you also try enabling Always On flag in Application settings of App service for better reliability?
image

We planned to add warm-up logic in our task and also reduce the number of calls for Auth tokens to make sure that the task is not failing related to this.

Always on is on for us and we do have a warm up.

Also for me 'Always on' is turned on for the web app and I use a warm up request before the 'Swap slots' release def. step

@hikirsch , @gkovacslmi , is the task failing consistently even with warm-up logic?
Can you please also share the activity logs from App Service to [email protected]?

@vincentdass we have AlwaysOn turned on and we are using the Application Initialization Module in our web.config for warming up our application.

@rsnj , Please send the activity logs of both source and destination slot to [email protected]
Also share the latest logs of the release to compare.
Is your slots present in same or different region?
Type of app: Windows / Linux (container) app?

@rsnj , any updates? Can you please answer to above questions?

@vincentdass we haven't been experiencing this issue lately. Things have been running much smoother.
Our staging slot is in the same App Service Plan in the same region.
It is a Windows app

@rsnj , thanks for the info.
We are in process of adding warm-up logic (ping both the slots) and reduce the auth token calls count.
This can help in adding more reliability.

6001

We hit this with app service on linux with Docker and the only thing that worked was to create an entirely new staging instance.

@pointtoken , can you try hitting the site once before swap slot? You can follow the recommendation here to add it in your release definition.
We have resolved this issue and the fix will be available in upcoming deployment.

Closing the thread, as the issue is resolved. The Fix will be available in next deployment.

@vincentdass any actions required from users affected by this? Re-add the Task or something? Or is it just automagic

@BobbyTable , no actions from user required. The deployment will be initiated (from our side) to all the regions.

What is the timeline for this deployment?

The deployment is currently in progress and the fix will be available in 0.0.23 task version.

@CameronVetter , Can you share the type of your web app? (Windows/Linux / Linux container)?
Can you share the whole error message for debugging?

This is a Linux web app using the PHP 5.6 runtime stack container. The full output of that task is:

2018-01-29T23:28:02.7034650Z ##[section]Starting: Swap Slots Stage and Prod 2018-01-29T23:28:02.7109159Z ============================================================================== 2018-01-29T23:28:02.7128340Z Task : Azure App Service Manage 2018-01-29T23:28:02.7143576Z Description : Start, Stop, Restart, Slot swap, Install site extensions or Enable Continuous Monitoring for an Azure App Service 2018-01-29T23:28:02.7157665Z Version : 0.2.22 2018-01-29T23:28:02.7176112Z Author : Microsoft Corporation 2018-01-29T23:28:02.7190924Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=831573) 2018-01-29T23:28:02.7204483Z ============================================================================== 2018-01-29T23:28:03.4078909Z Requesting swap slot for Web App : <PRIVATE> 2018-01-29T23:36:37.3168326Z Successfully updated deployment History at https://<PRIVATE>.scm.azurewebsites.net/api/deployments/76441517268969441 2018-01-29T23:36:39.2140442Z Successfully updated deployment History at https://<PRIVATE>.scm.azurewebsites.net/api/deployments/76441517268969441 2018-01-29T23:36:39.2277730Z ##[error]Error: Failed to swap slots for Azure Web App: <PRIVATE>. Error: Error: Failed request: (400) 2018-01-29T23:36:39.2718790Z ##[section]Finishing: Swap Slots Stage and Prod

For the last two days I have been getting swap errors using my VSTS task on multiple sites.
Trying via the Azure portal is also giving the same error:

This is a windows based web app.

"statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"BadRequest\",\"message\":\"Cannot swap slots for site 'mywebapp' because the worker process for 'stagingslotname' slot could not be started.\"}]}}"
},

Both the production slot and the staging slot are both receiving connections and serving requests at the time of starting the swap.

I have also tried via powershell which also times out.

This seems to be an interesting coincidence.

@sagoo33 , Can u ping the application URL of the slots and retry the swap?
There seems to be an issue with restarting the app service.

This seems to be back, even with doing a curl on the staging instance before swapping.

Agreed doing a curl before swapping does not help at all.

I had the same issue. In the end I deleted the web app and created it again. So far it has been working.

FYI guys, it looks like there is an issue with swapping when local cache is enabled. I switched local cache off in and it the swap works again:
https://social.msdn.microsoft.com/Forums/azure/en-US/20c44598-38b7-47ca-bd16-b9b35b72aedb/local-cache-issues?forum=windowsazurewebsitespreview

How does one disable the local cache? And what are the implications of doing so?

Well, it will only be enabled if you enabled it specifically in the application settings:
image

Some more discovery: it seems there's a new UI dialog in the portal that is preventing the swap from completing, where you are led to a "complete swap" screen. I think this is the source of the VSTS task failing.

I have just faced this issue. Then I tried to do the swap through Azure portal and there were some messages like previous value is this, and next value is this etc. I have updated slot configurations so all the slots have same config and then initiated a release from VSTS.

All went well without any issues.

@jaliyaudagedara , Can you please share the error message? Also the app type (Windows/Linux/ Container).

@vincentdass, sure!

Application Type: Azure App Service (ASP.NET Core)
Error:

2018-02-15T11:36:56.2828676Z ##[error]Error: Failed to swap App Service '{name}' slots - staging' and 'production'. Error: BadRequest - Cannot swap slots for site '{name}' because the application initialization in 'staging' slot either took too long or failed. Please check AppInit module configuration or try using swap with preview if application initialization time is very long. (CODE: 400)

Please let me know if I can be of any help.

This is back. When trying to swap, I get the error message:
Error: BadRequest - Cannot swap slots for site '********-website' because the worker process for 'int' slot could not be started. (CODE: 400)
Not sure why it started but I can't get a build into production. Sometimes I don't even get a built to successfully deploy. Nothing changed on our end. What gives?

Hey guys,
I've a same issue:
Error: Failed to swap App Service 'xx' slots - 'deploy' and 'production'. Error: BadRequest - Cannot swap slots for site 'xx' because the worker process for 'xxx' slot could not be started. (CODE: 400)

Both slots are warm up.
From logs is interesting this part:
`2018-03-21T09:10:06.8305796Z ##[debug][GET]https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/sites/xxx/slots/deploy/operationresults/xxx?api-version=2016-08-01
2018-03-21T09:10:07.2030502Z ##[debug]Response status code : 202
2018-03-21T09:10:22.2103647Z ##[debug]

[GET]https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/sites/xxx/slots/deploy/operationresults/xxx?api-version=2016-08-01
2018-03-21T09:10:22.7544295Z ##[debug]Response status code : 202
2018-03-21T09:10:37.7584011Z ##[debug]

[GET]https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/sites/xxx/slots/deploy/operationresults/xxx?api-version=2016-08-01
2018-03-21T09:10:38.2085733Z ##[debug]Response status code : 400`

Before these logs is 10 minutes with many Response status code : 202

@pointtoken , @pbartos , Can you please create a thread here to follow-up with App Service team? This error can also be repro-able from portal.

You may want to share the app name in private to debug the issue?

I am solving it over Azure support ticket but general hints are:

  • WarmUp slots
  • Execute swap over PowerShell
  • Delete and recreate slots

Same issue here with an App Service for Containers.

Brand new staging slot, the swap fails eventually, even though the site swaps and it all works.
I'm hitting the staging slot with curl before swapping over to prod.

@pbartos I had this issue once due to localcache being enabled - you don't happen to have that enabled do you?

@sagoo33 nailed it! I had just enabled Local Cache WEBSITE_LOCAL_CACHE_OPTION = Always and WEBSITE_LOCAL_CACHE_SIZEINMB = 500 but this prevented me from doing any subsequent swaps.

Reverting this change enabled swap to work properly again.

I am also having this issue with Github deployment. Was working fine for a number of swaps now getting

statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"BadRequest\",\"message\":\"Cannot swap slots for site 'XXX' because the worker process for 'XXX' slot could not be started.\"}]}}"

Don't have an appsetting for WEBSITE_LOCAL_CACHE_OPTION

Any help would be appreciated.

Was this page helpful?
0 / 5 - 0 ratings