We have a Microsoft Azure Function App in .NET Framework 4.8. We want to retrieve via Managed Identity a document out of our blob.
We're trying the use the following code:
BlobContainerClient containerClient = new BlobContainerClient(new Uri(containerEndpoint), new DefaultAzureCredential());
BlobClient blobClient = containerClient.GetBlobClient(mapName);
var bytes = blobClient.DownloadContent().Value.Content.ToArray();
To make this work we're using nuGet packages:
- Azure.Identity (latest version: 1.5.0)
- Azure.Storage.Blobs (latest version: 12.11.0) => This needs to work with Azure.Core 1.22.0
Whenever we try to POST a message to our function, we directly receive an error: Could not load file or assembly 'Azure.Core, Version=1.20.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies. The system cannot find the file specified.
Adding Azure.Core package version 1.22.0 or 1.20.0 direclty into the project is not helping.
It works if we either use Azure.Identity or Azure.Storage.Blobs, but not when using both.
In the project.assets.json file, we can see a dependency to version Azure.Core 1.20:
"Azure.Identity/1.5.0": {
"type": "package",
"dependencies": {
"Azure.Core": "1.20.0",
"Microsoft.Identity.Client": "4.30.1",
"Microsoft.Identity.Client.Extensions.Msal": "2.18.4",
"System.Memory": "4.5.4",
"System.Security.Cryptography.ProtectedData": "4.5.0",
"System.Text.Json": "4.6.0",
"System.Threading.Tasks.Extensions": "4.5.4"
},
Is there any way how we can reference in our Function App to use version 1.22.0 of the Azure.Core package?