Develop Solutions with Blob Storage Flashcards
Blob Storage
Types of unstructured data
Text
(1) Text
(2) Log
Binary
(3) Images/Videos
(4) Virtual Disks
Blob Storage
Storage account name restrictions
(1) 3 - 24 characters
(2) lower case letters and numbers only
Blob Storage
Does Blob support sub folders
No, but can use “virtual” folders by prepending a name
i.e., /mysubfolder/myblob.txt
Blob Storage
Two kinds of performance
(1) Standard > magnetic disks
(2) Premium > SSD
Blob Storage
Account Kinds
(1) Storage V2
(2) Storage V1
(3) Basic
Basic doesn’t have queues, fileshare and table storage
Storage V1 is previous version and not recommended for new accounts
Blob Storage *
Create a storage account using CLI
az storage account create –name $acctname
–resource-group $rgname
[–location $loc
–sku $sku (Standard_RAGRS)
–kind StorageV2]
Blob Storage *
Create a storage account using Powershell
New-AzStorageAccount
-Name $accountname
-ResourceGroupName $rgname
-Location $loc
-SkuName $sku (Standard_RAGRS)
[-Kind StorageV2]
Azure Blob
Types of authorization
(1) Shared Key (Storage Account Key)
(2) Shared Access Signature
(Token applied to a blob URL)
(3) Azure Active Directory
(4) Anonymous Public Read Access
(At container level)
Azure Blob *
Types of Blobs
(Note the difference between Standard/Premium)
(1) Block Blob
(2) Append Blob
(3) Page Blob
Blob blobs => stores its contents in seperate blocks and files are overwritten
Append Blobs => Use for logging
Page Blobs => for VHD, must have random read/writes
Azure Blob *
What are the replication strategies?
(1) LRS
(2) ZRS
(3) GRS
(4) GZRS
(5) RA-GRS
(6) RA-GZRS
Failover takes about an hour
Blob Storage
Basic objects used in SDK to connection to a blob?
(1) BlobServiceClient (storage account)
(2) BlobContainerClient (Blob Container)
(3) BlobClient (blobs)
Blob Storage
Understanding properties and metadata
What are the Blob Container System Properites?
What are the Blob System Properites?
What metadata do they share?
Blob Container System Properties
(1) ETag
(2) Last Modified
Blob
(1) ETag
(2) LastModified
(3) Content-Type
(4) Content-Length
(5) x-ms-blob-type
Common
User defined metadata and string-based key-value pairs
i.e. metadata.Add(“Category”, “Landscapes”);
What are the tiers and costs associated?
(1) Hot
storage high, transaction cost low
(2) Cool
storage medium, transaction cost medium
(3) Archive
storage low, transaction cost high
Can set the access tier individually for blob blobs
Archived blobs are offline. You can see the properites but not the blob itself until its access level has been changed. Rehydrating can take several hours
Example of setting access tier to a blob in code: await blobclient.SetAccessTierAsync(AccessTier.Cool)
Blob Storage
What is the Azure CLI for changing tier level?
az storage blob set-tier
–account-key $acctkey
–accountname $accountname
–container-name $containername
–name myphoto.jpg
–tier Cool
Blob Storage
What is lifecylce management?
Allows you to create rules such as checking last modified date and moving blob(s) to another tier or deleting them.
Can be filtered for specific blobs
Runs once a day
Blob Storage *
What’s the difference between snapshots and versions?
(1) A snapshot is a read-only copy of a blob at a point in time
(2) Version - You can upload a file with the same name and override the existing, yet a version of the previous file is saved. You can then go back and set the older version of the file. MUST HAVE VERSIONING ENABLED AT THE ACCOUNT LEVEL - it isn’t enabled by default
Azure Blob *
What is working with Leases?
If a lease is created, the blob cannot be Edited or Deleted.
The lease status is Locked and the lease duration is infinite.
You must click on “Break Lease”
Azure Blob
What is another more powerful way to provide immutability to blob(s)?
Add a policy for immutable blob storage and select either Legal Hold or Time Retention
Legal Hold - Add a tag to identify reason for legal hold. Need to remove policy in order to remove legal hold.
Time Retention - set to number of days. Blob can still be modified but not deleted
Azure Blob
What is the Azure CLI command for copying between Storage Accounts and Containers?
az storage blob copy start
–source-account-name $sourcename
–source-account-key $acctkey1
–source-container $containername
–source-blob $blobname
–account-name $destinationname
–account-key $acctkey2
–destination-container $destinationcontainername
–destination-blob $blobname
See image for batch copy
Azure Blob
What is AzCopy?
An Azure command line utility to help in copying blobs from local to Azure or from container to container
azcopy copy “Sourcepath” “targetpath” –recursive=true
Also see example between storage acounts - example shows using a SAS