Creating and Sharing Azure Blob Storage: A Step-by-Step Guide
Introduction
Azure Blob Storage offers a scalable and secure solution for storing and sharing unstructured data in the cloud. In this tutorial, we’ll walk through creating a Blob storage account, uploading files, and setting access policies to share files securely.
Step 1: Create a Blob Storage Account
- Log in to the Azure portal (https://portal.azure.com).
- Click “Create a resource” and search for “Storage account”.
3. Click “Create” on the Storage account page.
4. Fill in the basics:
- Subscription: Choose your subscription
- Resource group: Create new or select existing
- Storage account name: Enter a unique name
- Region: Choose a region close to you
- Performance: Standard
- Redundancy: Locally-redundant storage (LRS)
5. Click “Review + create”, then “Create”.
Step 2: Create a Container
- Once your storage account is created, go to its overview page.
- In the left menu, under “Data storage”, click “Containers”.
3. Click “+ Container” at the top.
4. Name your container (e.g., “myfiles”) and set the public access level to “Private”.
5. Click “Create”.
Step 3: Upload Files
- Click on your newly created container.
- Click “Upload” at the top
3. Click “Browse for files” and select a file from your computer.
4. Click “Upload”.
Step 4: Set Access Policies
To share files securely, we’ll create a Shared Access Signature (SAS) with specific permissions:
- In your storage account, go to “Shared access signature” in the left menu.
2. Configure the SAS:
- Allowed services: Blob
- Allowed resource types: Object
- Allowed permissions: Read
- Start and expiry date/time: Set as needed
- Allowed protocols: HTTPS only
- Click “Generate SAS and connection string”.
Step 5: Share the File
- Go back to your container and click on the uploaded file.
- Click “Generate SAS” in the top menu.
- Set permissions and expiry as needed.
- Click “Generate SAS token and URL”.
- Copy the “Blob SAS URL” — this is what you’ll share.
Conclusion
You’ve now created a Blob storage account, uploaded a file, and generated a secure link for sharing. This method allows you to control access to your files while leveraging Azure’s robust cloud infrastructure.Remember to manage your SAS tokens carefully and regenerate them as needed for security. Azure Blob Storage provides a flexible and scalable solution for file storage and sharing in the cloud.
So, whether you’re a tech enthusiast, a professional, or just someone who wants to learn more, I invite you to follow me on this journey. Subscribe to my blog and follow me on social media to stay in the loop and never miss a post.
Together, let’s explore the exciting world of technology and all it offers. I can’t wait to connect with you!”
Connect me on Social Media: https://linktr.ee/mdshamsfiroz
Happy coding! Happy learning!