Skip to content

Unable to get table reference or create table. Aborting write operation. #10995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Mikkelcv opened this issue Apr 11, 2025 · 20 comments
Open

Comments

@Mikkelcv
Copy link

Previous function runtime: 4.1037.1.23605
Current function runtime: 4.1038.300.25164

After the function runtime version has been updated to 4.1038 then our function app periodicaly every 10 minutes reports the exception:

"Unable to get table reference or create table. Aborting write operation."

Message:

This request is not authorized to perform this operation using this permission.
Time:2025-04-11T11:38:55.5555894Z
Status: 403 (Forbidden)
ErrorCode: AuthorizationPermissionMismatch

The execption originates in:
{"assembly":"Microsoft.Azure.WebJobs.Script.WebHost, Version=4.1038.0.0, Culture=neutral, PublicKeyToken=null","method":"Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository+<FlushLogs>d__30.MoveNext","level":34,"line":195,"fileName":"/_/src/WebJobs.Script.WebHost/Diagnostics/DiagnosticEventTableStorageRepository.cs"}

Granting the function app: "StorageTableDataContributor" RBAC role on the storage enables the function app to create an empty table in the storage.

Why is it now a requirement that this empty table must be created?
How do we disable this so we can have the old functionallity back?

It is NOT an option to grant this RBAC role to all function apps, we do not need this and wont grant access that is not required otherwise.

The guide:
https://learn.microsoft.com/en-us/azure/azure-functions/storage-considerations?tabs=azure-cli

Does not explain that the access is required. Is it something that is on its way?

@asos-chanhkiethuynh
Copy link

We have been experiencing the same issue as well out of no where, since 26/04/2025.

@scrocquesel-ml150
Copy link

The role "Storage Table Data Contributor" on the storage account is enough.

@rob-thijssen
Copy link

rob-thijssen commented Apr 14, 2025

I totally agree on all statements made by @Mikkelcv. Especially on this one:
It is NOT an option to grant this RBAC role to all function apps, we do not need this and wont grant access that is not required otherwise.

We're also experiencing this issue since april 11th, and our logs are already polluted with these messages for multiple subscriptions.
As a work-around we could add this statement: "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository": "None" to host.json in the logging/loglevel section. But for obvious reasons this is not the desired solution.
So could this please be fixed in a decent manner asap?

@WingTai
Copy link

WingTai commented Apr 15, 2025

We have also been experiencing this issue since around March 26th, with an increase in these errors since April 11th, even though we haven't deployed any new versions of the affected function apps in long time.

Any acknowledgement and fix from MSFT? Preferably would not like to apply the suggested workarounds.

@arjavgarg
Copy link

Yes, we also started seeing this issue on 3/26/2025, 9:25:43.665 AM (UTC)

@czeslav87
Copy link

+1

Multiple function apps, using Managed Identity access to storage with Storage Blob permissions only, started to throw this on 26th March 2025.

@LavanyaMullapudi2328
Copy link

Role assignment is not helping out. Still seeing the error even after assigning the "Storage Table Data Contributor " Role to the function app

@jviau
Copy link
Contributor

jviau commented Apr 16, 2025

This is a diagnostic feature running in the background. These failures are not impactful to the health of the app. There is a PR up to improve these logs.

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

AzureWebJobsFeatureFlags is a comma separated list of values, so if you have other values append this with a comma separator.

https://learn.microsoft.com/azure/azure-functions/functions-app-settings#azurewebjobsfeatureflags

@Azure Azure deleted a comment from SRE-Agent Apr 16, 2025
@nzthiago
Copy link
Member

@jviau if this exception is landing on customers' App Insights are we unnecessarily inflating their app insights (cost implications)?

@jviau
Copy link
Contributor

jviau commented Apr 16, 2025

@nzthiago the workarounds I provided will prevent it from going to app insights. The linked PR by @cjaliaga (#10996) will also greatly reduce the volume of telemetry emitted here. The diagnostic events feature will self-disable in this scenario (no permissions)

@nzthiago
Copy link
Member

Aha - thank you, it's that linked PR I missed so that customers don't need any workaround.

@thenecroscope
Copy link

This is a diagnostic feature running in the background. These failures are not impactful to the health of the app. There is a PR up to improve these logs.

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

AzureWebJobsFeatureFlags is a comma separated list of values, so if you have other values append this with a comma separator.

https://learn.microsoft.com/azure/azure-functions/functions-app-settings#azurewebjobsfeatureflags

This almost works for us. One question please
Can we combine both of these, for example;

AzureWebJobsFeatureFlags=DisableDiagnosticEventTableStorageRepository

I would prefer to handle the filtering at the Environment variable level if possible as we have so many function apps to update.

Many thanks,

@seilorjunior
Copy link

I am also seeing this issue with my customer, we gave the role in the storage, but we are still having the exceptions.

@thenecroscope
Copy link

I tried several environment setting / variables but no luck so far:

AzureFunctionsJobHost__logging__logLevel__Azure.Data.Tables = None
AzureFunctionsJobHost__logging__logLevel__Microsoft.Azure.WebJobs.Extensions.Tables = None
Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository = None

I think this approach may have worked, but it goes over the 100 character variable limit, so that failed also.
AzureFunctionsJobHost__logging__logLevel__Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository = None

@thenecroscope
Copy link

I tried to rollback to the previous Image using:

FUNCTIONS_EXTENSION_VERSION = 4.1037.1 (plus a few different combinations)
This appears not work on an EP1 Linux plan running dotnet-isolated 8.0

Weirdly when I set the version to 1.37.1, it downloads image 4.1037.1, not sure why this is|

I cant work out the correct way to pin to a specific image.

@Qaizer
Copy link

Qaizer commented Apr 23, 2025

@jviau
Will this AzureWebJobsFeatureFlags=DisableDiagnosticEventLogging have any other implications?

@thenecroscope
Copy link

@jviau Will this AzureWebJobsFeatureFlags=DisableDiagnosticEventLogging have any other implications?

For us this is not really a viable option unfortunately, as this will disable all logging and ideally we only want to disable Table logs for example

@jviau
Copy link
Contributor

jviau commented Apr 23, 2025

AzureWebJobsFeatureFlags=DisableDiagnosticEventLogging will only impact table logs. Logs to application insights, open telemetry, and azure monitor will not be affected.

@scrocquesel-ml150
Copy link

Could we have some documentation on this diagnostic feature ? I have functions using classic connectionString with those table logs. Didn't pay attention to them until now. Is this an old feature ? What are the Microsoft recommandation, should it be disabled by default ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests