Azure Function Host return internal server error on Swap operation.
See original GitHub issueCheck for a solution in the Azure portal
Diagnose and solve problems gave no insights into this problem.
Linux Consumption Azure function with deployment slot. I want to swap my production slot and the staging slot, I’ve tried the Azure Portal UI which throws a rather verbose error message with a 500 error code in it. Then tried to activate auto-swap through Terraform and get a different error there.
The investigative information below is just to locate the app, the swap errors are present in the activity log at:
- Tue Mar 15 2022 14:19:37 GMT+0100 (Central European Standard Time)
- Tue Mar 15 2022 14:13:43 GMT+0100 (Central European Standard Time)
- Tue Mar 15 2022 14:11:10 GMT+0100 (Central European Standard Time)
Investigative information
Please provide the following:
- Timestamp: 2022-03-15 03:04:37.635
- Function App version: 3
- Function App name:
- Function name(s) (as appropriate):
- Invocation ID: 16602e74-84ba-45d5-9260-dd932227fcd6
- Region: West Europe
Repro steps
I and you can repro this, just navigate to either Function or Function slot, hit the swap button and get presented with error. It’s a dev environment so I have no problem if you try this yourself anytime to verify/debug. 😃
Expected behavior
Expect application to swap slots.
Actual behavior
Azure portal throws the following:
Failed to complete swap between slot 'func-slot' and slot 'production'. Error: {"_body":"{\"Code\":\"InternalServerError\",\"Message\":\"There was an unexpected error swapping slots 'func-slot' and 'production' for site 'func(func-slot)'. Please try to cancel your swap operation.\",\"Target\":null,\"Details\":[{\"Message\":\"There was an unexpected error swapping slots 'func-slot' and 'production' for site 'func(func-slot)'. Please try to cancel your swap operation.\"},{\"Code\":\"InternalServerError\"},{\"ErrorEntity\":{\"ExtendedCode\":\"04093\",\"MessageTemplate\":\"There was an unexpected error swapping slots '{0}' and '{1}' for site '{2}'. Please try to cancel your swap operation.\",\"Parameters\":[\"func-slot\",\"production\",\"func(func-slot)\"],\"Code\":\"InternalServerError\",\"Message\":\"There was an unexpected error swapping slots 'func-slot' and 'production' for site 'func(func-slot)'. Please try to cancel your swap operation.\"}}],\"Innererror\":null}","status":500,"ok":false,"statusText":"OK","headers":{"cache-control":["no-cache"],"content-length":["1106"],"content-type":["application/json; charset=utf-8"],"date":["Tue"," 15 Mar 2022 13:11:10 GMT"],"etag":["\"1D8386E165ECFE0\""],"expires":["-1"],"pragma":["no-cache"],"server":["Microsoft-IIS/10.0"],"strict-transport-security":["max-age=31536000; includeSubDomains"],"x-aspnet-version":["4.0.30319"],"x-ms-correlation-request-id":["41a5a379-b64d-4747-a868-7fd226587f27"],"x-ms-failure-cause":["service"],"x-ms-ratelimit-remaining-subscription-writes":["1198"],"x-ms-request-id":["41a5a379-b64d-4747-a868-7fd226587f27"],"x-ms-routing-request-id":["GERMANYNORTH:20220315T131110Z:41a5a379-b64d-4747-a868-7fd226587f27"],"x-powered-by":["ASP.NET"]},"type":2,"url":"https://management.azure.com/subscriptions/[redacted:)]/resourceGroups/[redacted:)]/providers/Microsoft.Web/sites/func/slots/func-slot/slotsswap?api-version=2018-11-01"}
Known workarounds
Sorry, no known workaround what I’ve found
Related information
Provide any related information
- Programming language used C# .Net Core
- Links to source
- Bindings used
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Related StackOverflow Question
Hi @pragnagopa Could you please direct us to the right person to investigate the issue further?
FYI
I got some more info in the “Health & Diagnostics” thing in the portal, the error there said “There was a conflict. VnetRouteAllEnabled has diffirent values as site property and site config”
I do use a vnet for my production slot but i didn’t have one for my staging slot. I then added a vnet for my staging slot and when it was created the option VnetRouteAllEnabled was enabled. I then disabled that and tried to swap and then it worked.
Note that i didn’t have an issue with a function app but a Linux web app, but i suppose it’s the same more or less.