Introduction

Recently, we added a mandatory diagnostic setting to the blob service in our storage account module. This sends audit logs to a central log analytics workspace.

resource diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
  scope: blobService
  name: 'auditlogs'
  properties: {
    logs: [
      {
        enabled: true
        categoryGroup: 'audit'
      }
    ]
    workspaceId: auditWorkspace.id
  }
}

When Issues Arise

When updating the storage account module in the infra repository of a DevOps team, errors began to appear in their application insights. Errors like:

  • Error occurred when attempting to purge previous diagnostic event versions.
  • Unable to get table reference or create table. Aborting write operation.

All of them had Category "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository"

Quest for answers

We had no idea why this happened, so we began our quest and quickly found multiple issues on the "Azure Functions Host" GitHub repository.

Luckily this bug was fixed in october last year with the PR 'Added support for identity-based connections to Diagnostic Events' and released on December 19th in version 4.837.0.

We used a managed identity to assign the correct roles to the functions on the storage account. Upon checking the error logs, we discovered that we were using SDK version 4.1038.300.25164. But the problem was that downgrading is not possible. we tried to change FUNCTIONS_EXTENSION_VERSION, but it does not work as expected. So we had to find out why this error is back and how to fix this.

We found out that MSFT updated to version 4.1038.300.25164 on 4/16/2025. Before that, the logs show version 4.1037.1.23605, where there were no problems. For now, we have to wait for a fix, but we can find 2 issues in the Azure Function Host GitHub with some temporary changes to avoid/ignore the errors.

Temporary solutions

Here are some options that are given in the issues:

  • For the time being, you can add a log filter for Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository to host.json and filter out logs.
  • You can also disable this feature via an app setting: AzureWebJobsFeatureFlags=DisableDiagnosticEventLogging.

The PR we are waiting for to be released right now is PR 10996.