Search This Blog

Azure Storage

  • Different type of storage account services
    • Blog - Disc files of VM, video files, audio files. 
    • Table (this is not Azure SQL database) 
      • Its a Structured and NO - SQL database
      • Key values are stored in this
      • cost is lesser than usual sql database for same amount of data. 
      • Not useful if we have complex join and stored procedure type requirement. 
    • Queue and
    • File
  • Types of storage account 
    • General purpose v2 accounts - Recommended by Azure. All services like blob, table, file, queues are available.  hot, cool and archive tiers
    • General purpose v1 accounts- Gives all services like blob, table, file, queues are available. but not hot, cool and archive tiers
    • BlockBlobStorage account - 
    • File Storage account - Premium account when only file storage is required. 
    • Blob Storage account - Legacy account. 
  • Table service is available for both Storage account and Cosmos DB
  • SAS(Shared Access Signature) - We generate SAS when we want to share particular blob (not container). Share via access key or connections string give full container access. Share via Iam(share based on role, RBAC) give you access at storage level and container level. 
    • We can generate SAS at account level as well. 
=========================================================================
Blob
  • Creation of container is required. 
  • 3 types
    • Block blobs - Used for storing text and binary data
    • Append Blobs - fog logging data
    • Page Blobs - Virtual hard disc of VM. 
  • Replication Techniques
    • LRS- Local redundant storage synchronous 3 times within physical location of single data center
    • ZRS - Zone. Synchronous 3 times across zone. data available in case of data center failure. 
    • GRS - Primary region and secondary region. secondary is available only when primary is down 
    • Ra-GRS - Both secondary and first are available but second is read only. 

Classes used for Blob storage - Recent version
Azure.Storage.Blobs v12.4.1 dll

1) BlobServiceClient Class - This is used as a logical representation of the Azure Storage account and provdies access to work with the Blob service.
You can use the Constructor of the BlobServiceClient class to pass in the connection string to connect to the Azure Storage account.

You then have methods such as
a) CreateBlobContainer and CreateBlobContainerAsync- This can be used to create a container
b) GetBlobContainerClient - This returns a reference to an existing container

2) BlobContainerClient - This is used as a logical representation of the container service in the Azure Storage account
You then have methods such as
a) GetBlobClient - This is used to get a logical representation to a blob
b) GetBlobsAsync - This is used to return a list of blobs in a container. Each blob is returned as an object of the class BlobItem


3) BlobClient - This class is used to work with Azure Storage Blobs
You then have methods such as
a) Upload and UploadAsync - This can be used to upload a blob onto the container
b) Download and DownloadAsync - This can be used to download a blob from the container


4) BlobItem - This class is used to represent a Blob in a container.
For the BlobItem class , you have properties such as Metadata, Name , Properties and Snapshot

No comments:

Post a Comment