Skip to content
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

Value cannot be null. (Parameter 'connectionString') in DiagnosticEventTableStorageRepository using system assigned managed identity #10669

Open
DavidVollmers opened this issue Dec 4, 2024 · 3 comments
Assignees

Comments

@DavidVollmers
Copy link

Investigative information

Please provide the following:

  • Timestamp: 2024-12-04T15:27:38.8719369Z
  • Function App version: 4.1036.2.2 (Host version)
  • Function App name: role-functions-staging-ca
  • Function name(s) (as appropriate): -
  • Invocation ID: -
  • Region: West Europe

Repro steps

  1. Setup new function app on container app using system assigned managed identity
  2. Set AzureWebJobsStorage__accountName as described in here
  3. Deploy container image

Expected behavior

The class DiagnosticEventTableStorageRepository should work in combination with system assigned managed identities.

Actual behavior

The container app fails to start with the following error:

The Azure Storage connection string is either empty or invalid. Unable to record diagnostic events, so the diagnostic logging service is being stopped.

Value cannot be null. (Parameter 'connectionString') at Azure.Data.Tables.TableServiceClient..ctor(String connectionString,TableClientOptions options) at Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.DiagnosticEventTableStorageRepository.get_TableClient() at /src/azure-functions-host/src/WebJobs.Script.WebHost/Diagnostics/DiagnosticEventTableStorageRepository.cs : 69

Related information

Using mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 as a base image.

Package and Framework references:

<FrameworkReference Include="Microsoft.AspNetCore.App"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" Version="5.5.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1"/>
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0"/>
@Red1971
Copy link

Red1971 commented Dec 5, 2024

I am having a similar issue with my Azure Function App. I am using a 'user-assigned-identity' (UAI) to access the 'working storage account' (WSA).

The UAI has been granted RBAC perms on the WSA...

"Storage Blob Data Contributor", "Storage Queue Data Contributor", "Storage Account Contributor", "Storage Blob Data Owner", "Storage Table Data Contributor"

Image

@cjaliaga
Copy link
Member

cjaliaga commented Dec 5, 2024

Hey @DavidVollmers , thank you for providing the detailed information.

Support for identity-based connections will be included in the next release (PR: #10438). That said, this issue shouldn't cause the function app to fail to start. Are you observing a start failure, or is this just being logged during initialization?

@DavidVollmers
Copy link
Author

The function app fails to start, but I found out that this actually happens because of some custom startup logic.

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

3 participants