Configuring Azure storage explorer

Renuka Prasad N P 20 Reputation points Microsoft Employee
2023-07-28T03:19:03.7+00:00

I am trying to configure ASE, how do I get the URL for the blob / container which I need to access to ?

Thanks,

Renuka Prasad

Azure Storage Explorer
Azure Storage Explorer
An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
240 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sumarigo-MSFT 44,906 Reputation points Microsoft Employee
    2023-08-03T10:18:32.9366667+00:00

    @ Renuka Prasad N P Posting the Offline discussion, For generating the SAS token, which can benefit other community member reading this thread.

    using Azure.Storage.Blobs;
    using Azure.Storage.Sas;
    using Azure.Identity;
    using System;
    // Get the account name and container name.
    string accountName = "<your_account_name>";
    string containerName = "<your_container_name>";
    // Create a new ClientSecretCredential object to authenticate with AAD using the app client ID and secret.
    ClientSecretCredential credential = new ClientSecretCredential("<your_tenant_id>", "<your_client_id>", "<your_client_secret>");
    // Create a new BlobServiceClient object using the account name and the credential.
    BlobServiceClient blobServiceClient = new BlobServiceClient(new Uri($"https://{accountName}.blob.core.windows.net)
    // Create a new BlobSasBuilder object to generate the SAS token.
    BlobSasBuilder sasBuilder = new BlobSasBuilder()
    {
        BlobContainerName = containerName,
        Resource = "c",
        ExpiresOn = DateTimeOffset.UtcNow.AddHours(1)
    };
    // Set the permissions for the SAS token.
    sasBuilder.SetPermissions(BlobSasPermissions.Read);
    // Generate the SAS token using the BlobSasBuilder object and the StorageSharedKeyCredential object.
    string sasToken = sasBuilder.ToSasQueryParameters(new StorageSharedKeyCredential(accountName, credential)).ToString();
    // Print the SAS token.
    Console.WriteLine(sasToken);
    

    Please let us know if you have any further queries. I’m happy to assist you further.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. RevelinoB 2,780 Reputation points
    2023-07-28T04:04:32.7433333+00:00

    Hi Renuka,

    If you wanna get the URL for your Azure blob/container? Here's how you do it:

    • Log in to the Azure portal.
    • In the left-hand menu, click on "Storage accounts".
    • Click on the name of your storage account.
    • In the storage account window, click on "Blobs" under the "Blob service" section.
    • Click on the name of your blob container. You're now in your blob container, where you can see all of your blobs.
    • To get the URL of the container, check the top of the page. You should see something like https://mystorageaccount.blob.core.windows.net/mycontainer. This is the URL of your container.
    • To get the URL of a blob, just click on the blob, and then copy the URL from the new page. It should be something like https://mystorageaccount.blob.core.windows.net/mycontainer/myblob.

    Remember to replace "mystorageaccount", "mycontainer", and "myblob" with your storage account name, your container name, and your blob name, respectively.

    You also have to consider how you're managing access to your blob storage. If the blob/container isn't public, you'll need to use a Shared Access Signature (SAS) token to access it. You can create SAS tokens in the Azure portal.

    When you create a SAS, Azure provides a URL that includes the SAS token, and you can use this URL to access the blob/container. This URL will look like: https://mystorageaccount.blob.core.windows.net/mycontainer/myblob?sv=...&sig=...&spr=...&se=...&sp=..., where the part after the "?" is the SAS token.

    Please note that the actual SAS URL will be much longer, as the SAS token includes various pieces of information, such as the permissions granted by the SAS, the start time of the SAS, the expiry time of the SAS, etc.

    I hope this helps! Let me know if you have any other questions.