Using Azure Blob Storage for Unstructured Data

Using Azure Blob Storage for Unstructured Data

Introduction

Azure Blob Storage is a cloud-based service designed to store large amounts of unstructured data, including text and binary data. It is scalable, durable, and secure, making it an ideal solution for storing files such as images, videos, backups, and logs. This guide will walk you through the process of creating a Blob Storage account, uploading files, and setting access policies for secure sharing.

Prerequisites

  • Azure Account: An active Azure account is required to access the Azure portal. If you do not have one, you can sign up for a free account here.

  • Azure Portal: This guide uses the Azure Portal for demonstration.

Steps to Use Azure Blob Storage

Step 1: Create a Blob Storage Account

1. Log in to the Azure Portal

  • Navigate to the Azure Portal and log in with your Azure credentials.

2. Create a Storage Account

  1. In the search bar, type “Storage accounts” and click on the result.

  2. Click on the + Create button at the top of the page.

In the Basics Tab:
  • Subscription: Select your Azure subscription.

  • Resource Group: Choose or create a new resource group (a container for related resources).

  • Storage Account Name: Enter a unique name for your storage account (e.g., “myblobstorage2024”).

  • Region: Select the region closest to your user base.

  • Performance: Choose Standard for most use cases.

  • Replication: Select Locally-redundant storage (LRS) unless more advanced replication options are needed.

  • Leave the remaining settings as default unless adjustments are necessary.

  1. Click Review + create and then Create.

3. Verify Storage Account Creation

  • Wait for the deployment to complete (usually takes 1-2 minutes).

  • Once deployed, click on “Go to resource” to navigate to the storage account.

Step 2: Upload Files to Blob Storage

1. Navigate to Blob Service

  • In your newly created storage account, look for the Data storage section in the left-hand menu and select Containers.

2. Create a Blob Container

  1. Click on + Container.

  2. Name the container (e.g., “myfiles”) and set the Public access level to Private (no anonymous access) for security.

  3. Click Create.

3. Upload Files

  1. After creating the container, click on its name (e.g., “myfiles”).

  2. Click on Upload.

  3. In the Files section, click Browse to select the file(s) you want to upload from your local system.

  4. Once the file is selected, click Upload.

Step 3: Set Access Policies to Share Files

You can share files using different access policies based on your requirements.

Option 1: Setting Container-Level Public Access

  1. Change Public Access Level:

    • In the Containers view, click on the container where your files are stored (e.g., “myfiles”).

    • Click on the Settings (three dots) in the top right corner, then select Change access level.

    • Choose one of the following access levels:

      • Private: No anonymous access; only account owners can access.

      • Blob: Anonymous read access for blobs only; users can view content but not the container.

      • Container: Anonymous read access for both container and blob data.

    • Click OK.

  2. Share Blob URL:

    • To share an individual file, navigate to the file in the container and click on its name.

    • Click on Properties and copy the Blob URL. This URL can be shared with others to access the file.

Option 2: Using Shared Access Signature (SAS) Tokens for Granular Access

If you need to provide time-bound access to files or containers, use a Shared Access Signature (SAS) token.

  1. Generate a SAS Token:

    • In the storage account’s Overview pane, click on Shared access signature in the left-side menu.

    • Configure the Start and Expiry times for the access.

    • Select the permissions you want to provide (e.g., read, write, delete, etc.).

    • Click Generate SAS token and URL.

  2. Copy SAS URL:

    • After the token is generated, you will receive two links:

      • SAS Token: This can be appended to the storage URL for specific access.

      • Blob service SAS URL: This URL contains the SAS token and can be shared directly with others to access the file or container.

    • Copy and share the Blob service SAS URL with your collaborators.

Conclusion

Azure Blob Storage offers a secure, scalable, and flexible platform for storing unstructured data. By managing access at both the container and blob level, you can efficiently share files securely with others. Whether for personal use, business applications, or data backups, Azure Blob Storage is a robust solution for all your data storage needs.