webapp:Azure deployments - Slot swapping failed to apply changes to all instances of scaled up AppService
Our team have came across with 404 responses while running integration tests after a fresh deployment of our API I have been investigating it and I have found following issues.
I used fiddler to query the endpoint and could reproduce the bug, below are the responses Fiddler Request
GET https://awesome-internal-api.azurewebsites.net/endpoint HTTP/1.1
Host: awesome-internal-api.azurewebsites.net
Authorization: bearer {token}
Cache-Control: no-cache
Success
HTTP/1.1 200 OK
Content-Type: application/json
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Set-Cookie: ARRAffinity=a848697635096fe43d824473381245e6c5b2500699b8216381412588e39c629b;Path=/;Domain=awesome-internal-api.azurewebsites.net
Date: Wed, 29 Mar 2017 10:49:38 GMT
Content-Length: 161
{Valid JSON Response}
Failed
HTTP/1.1 404 Not Found
Content-Length: 103
Content-Type: text/html
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Set-Cookie: ARRAffinity=ddce0ce0360a57c79d2e3292cc6991ebfca9940eff307fbc2b4998e9e783aa3a;Path=/;Domain=awesome-internal-api.azurewebsites.net
Date: Wed, 29 Mar 2017 10:49:36 GMT
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
As you can see, the requests that are failing are hitting another instance that does not have any running apps or some old obsolete version.
I have manually restarted the AppService instance and everything came back to normal.
My deployment steps are :
Create a Staging slot using Azure SDK function:
New-AzureRmWebAppSlot -ResourceGroupName $resourceGroupName -Name $webAppName -Slot $deploymentSlot -AppServicePlan $appServicePlan.Id
Deploy a artifact zip file using VSTS Task (it is using MSDeploy):
AzureAppServiceDeploy - with Deploy to slot ticked and Slot = Staging
Swap and delete Staging slot using Azure SDK Functions:
Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType "Microsoft.Web/sites/slots" -ResourceName "$($webAppName)/$($stagingSlotName)" -Action slotsswap -Parameters $ParametersObject -ApiVersion $apiVersion -Force
Remove-AzureRmResource -ResourceGroupName $resourceGroupName -ResourceType "Microsoft.Web/sites/slots" -Name "$($webAppName)/$($stagingSlotName)" -ApiVersion $apiVersion -Force
In order to fix this I have to do a post deployment service restart. or use MSDeploy and enable "Take application offline" whoever that will land me into a different intermittent Connection Terminated problem .
@akurmi, please take a look, and assign to a milestone as appropriate
Any ETA on this please? We're also seeing this happen.
@ruslany or @naveedaz, can you shed some light on this? thank you.
Any updates on this?
@Tino92 - please let us know the web app name and the UTC time when this repro'd recently and we'll take a look.
Hey @ruslany. Sorry for the late answer. Is it possible to send the information over email?
Hello, any updates on this please? We are facing the same issue.
@Tino92 and @laanaithossam are you still facing this issue, if so can you please share the info that Ruslan mentioned above " please let us know the web app name and the UTC time when this repro'd recently and we'll take a look." - you can follow this link on how to share this info with us https://github.com/projectkudu/kudu/wiki/Reporting-your-site-name-without-posting-it-publicly
Closing this we didn't hear anything back on this - please follow the instructions above to share the data with the team directly if this is still an issue.