Function App: Azure.Storage.Blobs: Value cannot be null

ghz 8months ago ⋅ 65 views

I have published a function from Visual Studio 22 but I get two errors. I go to the configuration in Function App to see the value of AzureWebJobsStorage. In this place I saw AzureWebJobsStorage 's value and It is same connectionString of my Visual Studio solution (the string I get from Storage Account > Access keys).

I don't know why AzureWebJobsStorage return a fail: Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Azure.Storage.Blobs: Value cannot be null. (Parameter 'connectionString').enter image description here

Answers

The error message you're encountering, "Error configuring services in an external startup class. Value cannot be null (Parameter 'connectionString')", typically indicates that there's an issue with the Azure Storage connection string (AzureWebJobsStorage) being used in your Azure Functions app.

Here are some steps you can take to troubleshoot and resolve this issue:

  1. Verify Connection String: Double-check the AzureWebJobsStorage connection string in your Azure Functions app settings. Ensure that the connection string is correctly formatted and points to the Azure Storage account you intend to use.

  2. Check Access Keys: Ensure that you're using the correct access keys for your Azure Storage account. You can find the access keys in the Azure portal under your Storage account's settings > Access keys. Make sure that you're using the primary or secondary access key as part of the connection string.

  3. Restart Function App: Sometimes, restarting the Azure Functions app can resolve configuration issues. You can do this from the Azure portal by navigating to your Function App and selecting "Restart" from the "Overview" blade.

  4. Update Azure SDK: Ensure that you're using the latest version of the Azure SDK in your Visual Studio solution. Outdated SDK versions may have compatibility issues with Azure services.

  5. Review Startup Class: If you have an external startup class (Startup.cs), review it for any configuration errors related to Azure Storage. Ensure that the Azure Storage connection string is being retrieved correctly and passed to the appropriate services.

  6. Check Dependency Injection: If you're using dependency injection in your Azure Functions app, ensure that the Azure Storage connection string is properly injected into the services that require it.

  7. Debug Locally: Try debugging your Azure Functions locally to see if you encounter the same error. This can help isolate the issue and determine if it's specific to the Azure environment.

If you're still unable to resolve the issue, consider providing more details about your Azure Functions app setup and configuration for further assistance.