Update Web Apps Functions Host Function Keys failed with ARM deployment

Prabin Paudel 21 Reputation points

We have Azure DevOps release pipeline that provision multiple Azure Functions, however this morning the deployment of one of the app failed due to following :

Operation name : Update Web Apps Functions Host Function Keys
Time stamp : Wed Sep 29 2021 06:05:06 GMT-0700 (Pacific Daylight Time)
Event initiated by : <removed>
Error code : BadRequest
Message : Encountered an error (InternalServerError) from host runtime.

Here is a snipped of the JSON request/response copied from Azure portal :

    "authorization": {
        "action": "Microsoft.Web/sites/host/functionKeys/write",
        "scope": ""
    "caller": "",
    "channels": "Operation",
    "claims": {
        "aud": "https://management.azure.com/",
        "iss": "",
        "iat": "",
        "nbf": "",
        "exp": "",
        "aio": "",
        "appid": "",
        "appidacr": "",
        "http://schemas.microsoft.com/identity/claims/identityprovider": "",
        "http://schemas.microsoft.com/identity/claims/objectidentifier": "",
        "rh": "",
        "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "",
        "http://schemas.microsoft.com/identity/claims/tenantid": "",
        "uti": "",
        "ver": "",
        "xms_tcdt": ""
    "correlationId": "",
    "description": "",
    "eventDataId": "",
    "eventName": {
        "value": "EndRequest",
        "localizedValue": "End request"
    "category": {
        "value": "Administrative",
        "localizedValue": "Administrative"
    "eventTimestamp": "2021-09-29T13:05:06.0034471Z",
    "id": "",
    "level": "Error",
    "operationId": "",
    "operationName": {
        "value": "Microsoft.Web/sites/host/functionKeys/write",
        "localizedValue": "Update Web Apps Functions Host Function Keys"
    "resourceGroupName": "",
    "resourceProviderName": {
        "value": "Microsoft.Web",
        "localizedValue": "Azure Web Sites"
    "resourceType": {
        "value": "Microsoft.Web/sites/host/functionKeys",
        "localizedValue": "Microsoft.Web/sites/host/functionKeys"
    "resourceId": "",
    "status": {
        "value": "Failed",
        "localizedValue": "Failed"
    "subStatus": {
        "value": "",
        "localizedValue": ""
    "submissionTimestamp": "2021-09-29T13:06:28.1586712Z",
    "subscriptionId": "",
    "tenantId": "",
    "properties": {
        "statusCode": "BadRequest",
        "statusMessage": "{\"Code\":\"BadRequest\",\"Message\":\"Encountered an error (InternalServerError) from host runtime.\",\"Target\":null,\"Details\":[{\"Message\":\"Encountered an error (InternalServerError) from host runtime.\"},{\"Code\":\"BadRequest\"},{\"ErrorEntity\":{\"Code\":\"BadRequest\",\"Message\":\"Encountered an error (InternalServerError) from host runtime.\"}}],\"Innererror\":null}",
        "eventCategory": "Administrative",
        "entity": "",
        "message": "Microsoft.Web/sites/host/functionKeys/write",
        "hierarchy": ""
    "relatedEvents": []
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,607 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,241 Reputation points

    Hi @Prabin Paudel

    Welcome to Microsoft Q&A!

    Are you consistently facing this issue with the same ARM template? If not, this could be a transient (short lived) error. Based on the information above, one of the suggestions would be to set deployment order using depends on in ARM template, so that the Function App and config are ensured to be created before the Key write operation is performed.
    In case you are facing this issue frequently, we will need more details from the trace to examine the underlying issue. Please let me know if you have any questions.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful