How to upload content using REST API to Azure Blob storage

Satyam Bala 0 Reputation points
2023-12-28T14:23:39.45+00:00

Hi,

I have a requirement to upload the large content (~10GB) to a cloud blob storage, as shown in the below picture.

Step 1: User initiate the upload function to our private micro-service, and it should return a pre-signed URL(s)

Step 2: User now uploads the content securely to Azure Blob storage directly using REST APIs.

blob-store

  1. What is the right Azure service/technology to adopt above design.
  2. Is this design scalable using Azure service/technology.
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,199 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Konstantinos Passadis 19,591 Reputation points MVP
    2023-12-28T14:49:21.6833333+00:00

    Hello @Satyam Bala !

    Welcome to Microsoft QnA!

    1. API Management for the gateway
    2. Azure Functions
    3. Azure blob Storage

    Azure API Management allows you to set up HTTP REST APIs for your services and can integrate with Azure services securely.

    Azure Functions can integrate with Azure SDks and provide a SAS Url , pre signed with Expiration date that allows PUT only

    Example of how you might generate a SAS token for a blob using the Azure Storage SDK for .NET:

    csharp

    CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");

    SharedAccessBlobPolicy sasConstraints = new SharedAccessBlobPolicy

    {

    SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddHours(24),
    
    Permissions = SharedAccessBlobPermissions.Read | SharedAccessBlobPermissions.Write | SharedAccessBlobPermissions.List
    

    };

    string sasContainerToken = container.GetSharedAccessSignature(sasConstraints);

    string signedContainerUrl = container.Uri + sasContainerToken;

    The URL is used to make Uploads into Azure Blob Storage


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards


  2. Konstantinos Passadis 19,591 Reputation points MVP
    2023-12-30T19:38:23.63+00:00

    Hello @Satyam Bala !

    Security can be implemented by using specific timeframes for the SAS signature , limit access to specific IP , utilize Defender for Cloud , Access Controls and so on , please read ahead :

    https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview

    https://learn.microsoft.com/en-us/azure/well-architected/service-guides/storage-accounts/security

    https://learn.microsoft.com/en-us/azure/storage/blobs/security-recommendations

    https://learn.microsoft.com/en-us/azure/ai-services/Translator/document-translation/how-to-guides/create-sas-tokens?tabs=Containers#create-your-tokens-1

    Here is the link for Azure Storage libraries for Java

    https://learn.microsoft.com/en-us/java/api/overview/azure/storage?view=azure-java-stable


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards

    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.