https://learn.microsoft.com/en-us/answers/questions/798867/code-authorizationpermissionmismatch
Ensure that the Azure Function has the necessary permissions to interact with the Azure Storage Blob. This typically requires the Azure Function to have the Storage Blob Data Contributor role. If you're using azcopy or similar tools, the account used might also need Owner permissions on the blob storage
or
If you're using a method like GetAccessTokenAsync to generate access tokens for Azure Storage, ensure that the resource requested is the URL of your storage blob, not a general storage URL like
"https://storage.azure.com"``oaicite:{"number":2,"metadata":{"title":"Azure
Blob Storage
"Authorization Permission Mismatch" error for get request with AD token - Stack Overflow",
just solved this by changing the resource requested in the GetAccessTokenAsync method from "[https://storage.azure.com](https://storage.azure.com%5C/)" to the url of my storage blob as in this snippet:
public async Task<StorageCredentials> CreateStorageCredentialsAsync()
{
var provider = new AzureServiceTokenProvider();
var token = await provider.GetAccessTokenAsync(AzureStorageContainerUrl);
var tokenCredential = new TokenCredential(token);
var storageCredentials = new StorageCredentials(tokenCredential);
return storageCredentials;
}
where AzureStorageContainerUrl is set to
https://xxxxxxxxx.blob.core.windows.net","pub_date":null}}``​.