Azure / Azure/Azure-Functions

[BUG]: Conflict between Azure App Services Settings and Azure Functions (specifically 'function' auth compatibility)

Open
#2,416 2 comments 0 reactions 1 assignee Claimed by @bhagyshricompany View on GitHub
bug Needs: Attention :wave:
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Our repo uses Azure Pipeline Tasks and Azure Functions, and we have a healthCheck endpoint that is using anonymous authentication and 2 endpoints using 'function' authentication. The function authentication has some conflict with Azure App Service Settings. After the endpoint completes release, hits to the endpoint causes one of three errors on the 'function' authenticated endpoints (the anonymous function works everytime):

1. Endpoints that never return, just hang
2. Endpoints that return a 503 error
3. Endpoints that return a 401 error (example attached)
![401 Error](https://github.com/Azure/Azure-Functions/assets/8991089/d3987722-70cc-429e-be6f-2f57f26548ef)

The errors is persistent and repeatable, and we can only fix the site by re-releasing the pipeline.

We think there's some race condition between Azure App Services Settings that makes the functional authentication not work as expected. We can workaround this race condition by:

1. Introducing a delay in the pipeline after the Azure App Services Settings is run.

![Bash Delay Step](https://github.com/Azure/Azure-Functions/assets/8991089/01fea1b2-5027-43e3-8911-0d9c6c7c5fa1)

2. Turning off the Azure App Services Settings (obviously not useful)

3. Inverting the order of the Swap Slots Task step and the Azure App Services Settings (exposes us to a moment where the older settings are working on the new Slot)

5. Turning off the function authentication in our Azure Function (ok for now since that route has additional authentication, but not ideal for other planned work).

I will also file this bug with https://github.com/Azure/azure-functions-host/issues and have filed it with Azure Pipeline Tasks (https://github.com/microsoft/azure-pipelines-tasks/issues/19173)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.