How to access in azure blob

Anonymous
2023-08-11T04:26:16.55+00:00

I have assigned my Azure App Service account and my personal Azure account to the 'Role Assignments' in the 'Access control (IAM)' section of the Blob's access account. While the application deployed on the Azure App Service can access the blob successfully, I'm facing an issue where the application, when run locally in Visual Studio Code from my logged-in Azure account, cannot access the blob. How can I resolve this?
User's image

const account = "mock_account";
const url = `https://${account}.blob.core.windows.net`;
const credential = new DefaultAzureCredential();
const blobServiceClient = new BlobServiceClient(url, credential);
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,141 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,635 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ben Gimblett 4,555 Reputation points Microsoft Employee
    2023-08-14T08:25:08.6133333+00:00

    Hi , thanks for the question. The answer is that you need a credential within VS Code - you have two options, either sign in via a terminal window in VS Code using the Az CLI or use the account plug-in as documented here https://learn.microsoft.com/en-us/azure/developer/java/sdk/identity-azure-hosted-auth#default-azure-credential

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.