-
Notifications
You must be signed in to change notification settings - Fork 432
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
Cannot use premium tables in Azure Functions #2026
Comments
What using statements do you have? |
Same as I've seen in example from docs: https://github.com/Azure-Samples/azure-cosmos-db-table-dotnet-getting-started/blob/master/PremiumTableGetStarted/Program.cs Here is my csproj file:
|
So i tried this, and there doesn't seem to be anything functions specific about this behavior. I took the same code, ran it into a console application and it does the same thing:
Furthermore I looked inside the nuget you're referencing, and it does not contain an assembly by the name you expected. The assembly is very clearly called Microsoft.WindowsAzure.Storage: |
Ok, my mistake about the assembly name, but the fact remain is that it's not working - I receive 400 error code. I think the reason is that the wrong assembly is loaded - look at the version, it's 7.2.1.0 in Azure Function but 1.0.0 in console app. Please reopen. |
I suspect this is related to assembly binding redirects. I don't really understand what is going on with this premium tables library - it seems to mimic the azure storage library. The version shows as 1.0.0.0 but the assembly name and public key token are the same. Since Azure Functions has a binding redirect rule that applies to any version of azure storage older than 7.2.1.0, the rule is applied here and so the version of Microsoft.WIndowsAzure.Storage.dll that is included in this NuGet is not loaded. You can see this happening with the following code: CloudTable table = tableClient.GetTableReference("asdf");
var t = table.GetType();
string assembly = $"{t.Assembly.Location} {t.Assembly}";
log.Info(assembly); In a console app: In a function app:
So if I'm correct, this is an unfortunate side effect of the combination of how azure functions handles assembly binding redirects and how this library is authored. |
So what is the next step toward resolution? |
Honestly I'm not sure. I've reached out to a contact I have on the CosmosDB team to see if they have any ideas. |
This looks like a duplicate of #1751 So i'm closing it |
I'm trying to use premium tables but I get a 400 error code when I execute retrieve operation. After some investigation it looks like even though the premium tables nuget is referenced in csproj, what actually gets loaded by the run time is the standard version of WindowsAzure.Storage
Repro steps
Expected behavior
"assembly" should be WindowsAzure.Storage-PremiumTable
Actual behavior
"assembly" is Microsoft.WindowsAzure.Storage, Version=7.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
The text was updated successfully, but these errors were encountered: