[BUG] Azure.Storage.Blob 12.11.0 Exception: InvalidHeaderValue
See original GitHub issueLibrary name and version
Azure.Storage.Blob 12.11.0
Describe the bug
When installing Azure.Storage.Blob 12.11.0 into Class Project that is used by an Azure Function project. The following exception occurs.
Expected behavior
Be able to have an Azure Function reference another project that contains a reference to Azure.Storage.Blob 12.11.0
Actual behavior
The Azure Functions starts up but immediately throws the below exception.
Reproduction Steps
- Create an Azure Function Project using the Azure Function template. Add a simple Azure Function like the following
public class Function1
{
[FunctionName("BlobTriggerStart")]
public static async Task BlobTriggerClientFunction(
[BlobTrigger("{AddContainerName}/{name}", Connection = "{AddConnectionString}")] BlobClient blobClient, string name,
ILogger log, [DurableClient] IDurableOrchestrationClient starter)
{
try
{
log.LogInformation($"Started orchestration trigged by BLOB trigger. A blob item with name = '{name}'");
log.LogInformation($"BLOB Name {blobClient.Name}");
}
catch (Exception ex)
{
log.LogError("Something went wrong. Error : " + ex.InnerException);
throw;
}
}
}
-
Run the Azure Function: The project should run like normal
-
Create a Class Project and reference the Azure.Storage.Blob Nuget 12.11.0
- Note: No other code is needed. Just a reference to the NuGet package.
-
In the Azure Function Project, reference the Class Project
-
Run the Azure Function: The Exception should occur
-
In the Class Project, down grade Azure.Storage.Blob to 12.10.0
- Run the Azure Function. The project should run like normal
Environment
Windows 10 .NET 6 Visual Studio 17.1.5
Issue Analytics
- State:
- Created a year ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
InvalidHeaderValue Error in ADLS2 Blob trigger function ...
If you are using azurite (Storage emulator) while executing the function locally then this is a known issue.
Read more >Azure.RequestFailedException: The value for one of the HTTP ...
When working on Azure Functions with Azurite as blob storage emulator on my local computer, I encountered the following error:.
Read more >azure.storage.blob package — Azure SDK for Python 2.0.0 ...
There is a partial failure in batch operations. Parameters. message (str) – The message of the exception. response – Server response to be...
Read more >CreateIfNotExists error 400 - Microsoft Q&A
Can't tell what is producing this error. Used Azure Storage Explorer to confirm the Account and blob directory (server NOT emulated ... Common...
Read more >Versioning for Azure Storage
This section details known issues for the Azure Storage REST APIs. InvalidHeaderValue error message. In rare scenarios, applications making ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ToddEvansHome Thanks for getting back. We will now proceed with closure of this github issue. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.
@ToddEvansHome Thanks for sharing your project. I was able to reproduce the same issue. After doing some debugging, I was able to identify the cause. The 400 error with Invalid Header was due to the
x-ms-version: 2021-06-08
being sent by the Blob Storage SDK wasn’t matching the version used by the Azurite.This is a known issue and it is documented here.
You can run the below command to find the version of Azurite.
Below are the steps that I followed to fix this issue: I deleted the contents of the below folder.
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator
The Storage Emulator is available as part of the Microsoft Azure SDK. You can also install the Storage Emulator by using the standalone installer (direct download).
I upgraded my Azurite version to the most recent version 3.17.1 and that resolved the issue.
Launch Visual Studio again and test the FunctionApp. Hope this helps. Please let me know if you still face this issue. Awaiting your reply.