azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

webapp:Azure deployments - Slot swapping failed to apply changes to all instances of scaled up AppService

Open rodius opened this issue 9 years ago • 9 comments

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 .

rodius avatar Apr 02 '17 20:04 rodius

@akurmi, please take a look, and assign to a milestone as appropriate

markcowl avatar May 19 '17 18:05 markcowl

Any ETA on this please? We're also seeing this happen.

dannyc02 avatar Jun 26 '18 10:06 dannyc02

@ruslany or @naveedaz, can you shed some light on this? thank you.

panchagnula avatar Jun 26 '18 18:06 panchagnula

Any updates on this?

Tino92 avatar Jan 17 '19 08:01 Tino92

@Tino92 - please let us know the web app name and the UTC time when this repro'd recently and we'll take a look.

ruslany avatar Jan 17 '19 19:01 ruslany

Hey @ruslany. Sorry for the late answer. Is it possible to send the information over email?

Tino92 avatar Jan 21 '19 08:01 Tino92

Hello, any updates on this please? We are facing the same issue.

laanaithossam avatar May 23 '19 09:05 laanaithossam

@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

panchagnula avatar Jun 11 '19 20:06 panchagnula

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.

panchagnula avatar Jun 21 '19 05:06 panchagnula