Why does telemetry show multiple 401 errors when calling /admin/host/drain
I have deployed an Azure dotnet 8 isolated function app to a Linux Flex Consumption plan. Function application runs correctly, but when I examine the application insights telemetry, I am seeing a large number of errors; all of them for the POST /admin/host/drain operation.
Example transaction:
The Admin API documentation indicates that hitting the URLs require the functions' master key to be passed in the header as x-functions-key
. I am not making these calls, I believe they are being performed by the flex consumption plan scaler.
How do I configure my function application such that the admin api calls are authenticated successfully?