Reputation: 94
I have read the page with the same problem as I met.
This request is not authorized to perform this operation. Azure blobClient
I have set the IP, and after I used the class "CloudStorageAccount", I can connect to the Azure Storage.
But I want to use another class "BlobContainerClient" which is used as sample code for connecting to Azure emulator "Azurite".
https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite#azure-blob-storage
And I can successfully connect to Azurite in my Docker.
But I will only get the error "This request is not authorized to perform this operation.", when I change the connection string to connect to the real Azure Blob Storage.
var client = new BlobContainerClient(
new Uri("https://myaccount.blob.core.windows.net/container"),
new StorageSharedKeyCredential("myaccount", $"{AccountKey}"));
Here is what my connection string looks like. How can I connect to Azure Storage with this class? Or I should not use this class?
Upvotes: 0
Views: 1133
Reputation: 30025
When use the "Selected network", due to some reasons, like you're using vpn or proxy etc., the client ip which is detected by azure is not very accurate sometimes.
So you can use this cmd command to find your real client ip: curl -L ip.tool.lu
. Then manually add it in your azure portal. It works at my side.
Upvotes: 1