Java / Azure Blob Storage Interview questions
Last updated
1. What is Azure Blob Storage?
Azure Blob Storage is Microsoft's object storage service for large volumes of unstructured data such as images, videos, documents, logs, backups and analytics datasets. You reach it over HTTP/HTTPS through the REST API, client SDKs, the Azure CLI, PowerShell, AzCopy or the portal.
Data lives in a three-level hierarchy: a storage account holds containers, and each container holds blobs (the objects). There is no schema and no query language over the content itself, you simply store and fetch objects by name.
Typical uses include serving media to browsers, backup and archive, log retention, and acting as the storage layer for data lakes and big data jobs.
Take quiz
unstructured objects such as images, logs and backups
relational rows that need T-SQL joins
ordered messages consumed by queue workers
container, then storage account, then blob
storage account, then container, then blob
storage account, then table, then blob
blob, then container, then storage account
2. What are the types of blobs in Azure Blob Storage?
Azure Blob Storage supports three blob types, and the type is fixed when the blob is created:
- Block blobs - the default for files, media and backups. Built from blocks, up to roughly 190.7 TiB.
- Append blobs - optimized for append-only writes such as log files. Up to roughly 195 GiB.
- Page blobs - a collection of 512-byte pages for random read/write, up to 8 TiB. Used for VHD-based disks.
If you are unsure, pick block blob. The other two cover specific access patterns.
Take quiz
block blob with Put Blob only
append blob
page blob
512-byte pages
4000 MiB blocks committed by a block list
virtual directories with ACLs
3. What is a storage account in Azure?
A storage account is the top-level resource that gives you a unique namespace in Azure Storage. Every blob, file share, queue and table you create is addressed through it, and it is the unit where you set redundancy, networking rules, encryption and billing.
The account name must be 3-24 characters, lowercase letters and numbers only, and globally unique because it becomes part of the endpoint, for example https://myaccount.blob.core.windows.net.
For most workloads, use a Standard general-purpose v2 account. For low-latency, high-transaction blob workloads, use a Premium block blob account (kind BlockBlobStorage).
Take quiz
Standard general-purpose v2 with Cool default tier
FileStorage
BlockBlobStorage
1-63 characters, any case, unique per resource group
3-24 characters, lowercase letters and numbers, globally unique
3-24 characters, unique only within one subscription
4. What is a container in Azure Blob Storage?
A container groups a set of blobs inside a storage account, much like a top-level folder. An account can hold an unlimited number of containers, and a container can hold an unlimited number of blobs.
Containers cannot be nested. If you want folder-like structure, put slashes in blob names (such as 2026/oct/report.pdf) and list with a delimiter, or enable the hierarchical namespace for real directories.
Several settings are applied per container: the anonymous access level (private by default), stored access policies for SAS, legal holds and immutability policies. Names are 3-63 characters, lowercase letters, numbers and hyphens.
Take quiz
No, containers are flat; folders are simulated through blob names
Yes, up to 8 levels deep
Yes, but only with a Premium account
blob-level read access
container-level list and read access
private, with no anonymous access
5. What is the structure of an Azure blob URL?
Every blob has an address built from the account, the container and the blob name:
https://shopdata.blob.core.windows.net/invoices/2026/oct/inv-1001.pdf | | | | account service endpoint container blob name (includes virtual path)
Here shopdata is the account, invoices is the container, and 2026/oct/inv-1001.pdf is the blob name. The slashes are part of the name, not real folders, unless the hierarchical namespace is on.
Blob names are case-sensitive and can be up to 1,024 characters. Accounts with read-access geo-redundancy also expose a -secondary endpoint, and Data Lake accounts add a dfs.core.windows.net endpoint.
Take quiz
shopdata
2026
blob
invoices
they are case-sensitive and up to 1,024 characters
they are case-insensitive and limited to 63 characters
they must be lowercase and cannot contain slashes
6. What is an access tier in Azure Blob Storage?
An access tier lets you trade storage price against access price based on how often data is read. Frequently used data costs more to store but less to read, rarely used data is the opposite.
The account has a default access tier (Hot or Cool) that new blobs inherit. You can override it per blob, and Cold and Archive can only be set at the blob level. Tiers split into online (Hot, Cool, Cold, readable immediately) and offline (Archive, must be rehydrated first).
You change a tier with the Set Blob Tier operation or automate it with lifecycle management rules.
Take quiz
Hot and Cool
Hot and Archive
Cold and Archive
Cold
Cool
Archive
Hot
7. What are the redundancy options for Azure Storage?
Redundancy decides how many copies of your data exist and where. Azure offers six options:
- LRS - three copies inside one datacenter.
- ZRS - copies spread across three availability zones in one region.
- GRS - LRS in the primary region plus LRS copy in a paired secondary region.
- GZRS - ZRS in the primary region plus an LRS copy in the secondary region.
- RA-GRS and RA-GZRS - the geo options with read access to the secondary endpoint.
Designed durability rises from 11 nines (LRS) to 12 nines (ZRS) to 16 nines (GRS/GZRS) over a year.
Take quiz
LRS
ZRS
GRS
RA-GRS
writes to both regions at once
automatic failover without any data loss
read access to the secondary region's data
8. What is a block blob?
A block blob is the standard blob type for documents, images, video, backups and datasets. It is assembled from blocks that can be uploaded independently and in parallel, then committed together as one blob.
Each block can be up to 4,000 MiB and a blob can have up to 50,000 blocks, giving a maximum size of about 190.7 TiB. Small files can skip blocks entirely and use a single Put Blob call (up to 5,000 MiB).
Because blocks are uploaded separately, a failed block can be retried without restarting the whole transfer.
Take quiz
up to 5,000
up to 50,000
up to 500,000
blocks upload in parallel and failed ones can be retried alone
every write rewrites the entire blob atomically
they are stored on SSD disks only
9. What is an append blob?
An append blob is made of blocks like a block blob, but it only allows new blocks to be added at the end. You cannot modify or delete existing blocks, which makes it a safe fit for logs and audit trails.
Each append block can be up to 4 MiB, and a blob holds up to 50,000 blocks, so the maximum size is about 195 GiB. The Append Block operation is atomic, so concurrent writers never interleave half-written entries.
Use it when you write sequentially and never update earlier data. For anything else, a block blob is more flexible.
Take quiz
it can only be read once
it cannot be stored in the Hot tier
blocks can only be added at the end, never modified
4,000 MiB
4 MiB
512 bytes
10. What is a page blob?
A page blob is a collection of 512-byte pages designed for frequent random reads and writes. You can write to any page range without touching the rest, which is why it backs VHD files for unmanaged VM disks.
The maximum size is 8 TiB. Writes must be aligned to 512-byte boundaries, and the blob is created at its full size up front, though you are billed for the pages you actually write.
Today most VMs use managed disks, so page blobs show up mainly in older setups and in specialized scenarios that need sparse random-access files.
Take quiz
8 TiB
190.7 TiB
195 GiB
write-once compliance archives
static website HTML files
VHD files backing virtual machine disks
11. What is a Shared Access Signature?
A Shared Access Signature (SAS) is a signed URL token that grants limited access to storage resources without sharing your account key. The token encodes what is allowed, for how long, and optionally from which IP addresses.
A typical SAS defines the resource (blob or container), permissions such as read, write or delete, a start and expiry time, and the allowed protocol. You append it to the resource URL as a query string:
https://shopdata.blob.core.windows.net/invoices/inv-1001.pdf?sv=2024-11-04&sp=r&se=2026-10-12T10:00:00Z&sig=...
Anyone holding the URL gets exactly those rights until it expires, so keep lifetimes short.
Take quiz
permanently open a container to the internet
grant time-limited, permission-limited access without sharing the account key
replace Microsoft Entra ID roles for management operations
the permissions granted
the expiry time
the allowed IP range
the caller's Azure subscription ID
12. What are the types of SAS in Azure Storage?
Azure Storage supports three SAS types, differing in how they are signed and what they cover:
- User delegation SAS - signed with Microsoft Entra credentials through a user delegation key. Blob storage only, and the recommended option.
- Service SAS - signed with the account key, scoped to one service such as Blob, and optionally tied to a stored access policy.
- Account SAS - signed with the account key, can span several services and operations at the account level.
Only service SAS can reference a stored access policy, which lets you revoke or change many tokens by editing one policy.
Take quiz
service SAS
account SAS
user delegation SAS
user delegation SAS
service SAS
none of them
13. What are storage account access keys?
Each storage account has two access keys, key1 and key2. Either one gives full control of all data in the account, so they work like a root password.
Having two keys exists for rotation: you move applications to key2, regenerate key1, then switch back, all without downtime. Microsoft recommends storing keys in Azure Key Vault and rotating them regularly.
Better still, avoid them. You can set allowSharedKeyAccess to false so that only Microsoft Entra authorization (and user delegation SAS) is accepted.
Take quiz
so keys can be rotated without downtime
one is read-only and the other write-only
one is for Blob and the other for Queue
anonymous access
account SAS tokens only
Microsoft Entra authorization
14. What is AzCopy used for?
AzCopy is a command-line tool for fast, scriptable data transfer to and from Azure Storage. It handles parallel uploads, resumable jobs, wildcards and recursive folder copies, which makes it the usual choice for bulk migrations.
azcopy login azcopy copy "./reports" "https://shopdata.blob.core.windows.net/invoices" --recursive azcopy sync "./reports" "https://shopdata.blob.core.windows.net/invoices"
It can also copy between storage accounts server-side, so data moves over Azure's network instead of through your machine. Authenticate with azcopy login or a SAS appended to the URL.
Take quiz
azcopy login
azcopy sync
azcopy remove
server-side, so data does not pass through your machine
by zipping everything locally first
it cannot copy between accounts
15. How do you upload a blob using Azure CLI?
Use az storage blob upload and name the account, container, blob and local file. Adding --auth-mode login uses your Microsoft Entra sign-in instead of an account key, which needs a role such as Storage Blob Data Contributor.
az login az storage blob upload \ --account-name shopdata \ --container-name invoices \ --name inv-1001.pdf \ --file ./inv-1001.pdf \ --auth-mode login
For a whole folder, use az storage blob upload-batch with --source and --destination. Add --overwrite if the blob already exists.
Take quiz
--auth-mode key-only
--public-access blob
--auth-mode login
az storage blob sync-all
az storage blob upload-batch
az storage container copy
16. How do you upload a blob using the.NET SDK?
With the Azure.Storage.Blobs package, create a BlobServiceClient, get a container client, then a blob client, and call UploadAsync. DefaultAzureCredential keeps secrets out of your code.
var service = new BlobServiceClient( new Uri("https://shopdata.blob.core.windows.net"), new DefaultAzureCredential()); var container = service.GetBlobContainerClient("invoices"); var blob = container.GetBlobClient("inv-1001.pdf"); await blob.UploadAsync("./inv-1001.pdf", overwrite: true);
The SDK automatically splits large files into blocks and uploads them in parallel. Without overwrite: true, uploading to an existing name throws an error.
Take quiz
hard-coding an account key or connection string
needing a container name
the need for an internet connection
the old blob is silently replaced
the new blob is appended to the old one
the upload throws an error
17. What is blob soft delete?
Blob soft delete keeps deleted or overwritten blobs (and snapshots) recoverable for a retention period you choose, from 1 to 365 days. Instead of being removed, the blob is marked as soft-deleted and hidden from normal listings.
To bring it back, call Undelete Blob or use the portal's Show deleted blobs toggle. After the retention window ends, the data is permanently removed. A separate container soft delete setting protects whole containers.
Soft-deleted data still counts toward storage cost until it expires.
Take quiz
regional datacenter outages
accidental deletion or overwrite within the retention window
unauthorized reads of public blobs
Undelete Blob
Rehydrate Blob
Restore Account
18. What is blob versioning?
Blob versioning automatically keeps the previous state of a blob every time it is modified or deleted. Each earlier state becomes a read-only version identified by a version ID (a timestamp).
You can read, promote or delete any version. To restore an older one, copy it over the current blob. Versions are billed as extra storage, so pair versioning with lifecycle rules that delete old versions after a set number of days.
Versioning is a prerequisite for features such as object replication and point-in-time restore.
Take quiz
only when you call Create Snapshot
only once per day at midnight UTC
automatically on every overwrite or delete of the blob
turn versioning off and on weekly
lifecycle rules that delete old versions
move versions to a different account kind
19. What is a blob snapshot?
A snapshot is a read-only copy of a blob captured at a specific moment. You create it manually with Snapshot Blob, and it is identified by a DateTime value appended to the blob URI.
Snapshots only store blocks or pages that changed since the base blob, so they are space-efficient. They can be read, copied or deleted, but not modified, and you cannot delete a base blob that has snapshots unless you also remove them.
The key difference from versioning: snapshots are taken on demand, while versions are created automatically.
Take quiz
a snapshot is created manually, a version automatically
a snapshot is writable, a version is read-only
a snapshot is free of any storage charge
a GUID blob ID in the path
the lease ID
a DateTime value
20. What is the hierarchical namespace in Azure Storage?
The hierarchical namespace (HNS) turns a flat blob account into a real file-system-style structure with directories. It is the feature that makes an account Azure Data Lake Storage Gen2.
With HNS you get atomic directory rename and delete, POSIX-style ACLs on files and folders, and the abfss:// driver used by Spark and Hadoop. Without it, renaming a folder means copying and deleting every blob under that prefix.
It is normally enabled when you create the account. An upgrade path exists for supported accounts, but it is one-way.
Take quiz
automatic conversion of blobs to SQL tables
atomic directory operations and POSIX-style ACLs
unlimited free egress
abfss://
smb://
nfs4://
21. What is the difference between Hot, Cool, Cold, and Archive tiers?
All four tiers hold the same data. What changes is the price curve, the minimum storage time and whether the data is instantly readable.
| Tier | Storage cost | Access cost | Min. retention | Availability |
| Hot | Highest | Lowest | None | Online |
| Cool | Lower | Higher | 30 days | Online |
| Cold | Lower still | Higher still | 90 days | Online |
| Archive | Lowest | Highest | 180 days | Offline, rehydrate first |
Moving or deleting a blob before the minimum period triggers an early deletion charge. Pick Hot for active data, Cool or Cold for backups and older content you still read now and then, and Archive for compliance data you almost never touch.
Take quiz
Cool
Hot
Archive
Cold
more expensive storage but free reads
cheaper storage but more expensive reads and a 30-day minimum
the blob becomes offline until rehydrated
22. What is the difference between LRS and ZRS?
LRS keeps three synchronous copies inside a single datacenter. ZRS keeps three synchronous copies across three separate availability zones in one region.
| LRS | ZRS | |
| Copies | 3, one datacenter | 3, three availability zones |
| Survives datacenter failure | No | Yes |
| Survives region failure | No | No |
| Designed durability | 11 nines | 12 nines |
| Cost | Lowest | Higher |
Choose ZRS when you need the data to stay available through a zone outage. Neither protects against losing a whole region, for that you need a geo option.
Take quiz
the failure of a whole datacenter or availability zone
the loss of an entire Azure region
accidental blob deletion
in two paired regions
in one rack of the same datacenter
across three availability zones in one region
23. What is the difference between GRS and GZRS?
Both copy your data asynchronously to a secondary region hundreds of miles away. The difference is how the primary region is protected.
| GRS | GZRS | |
| Primary region | LRS (one datacenter) | ZRS (three zones) |
| Secondary region | LRS | LRS |
| Zone outage in primary | Data may be unavailable | Stays available |
| Region disaster | Covered | Covered |
GZRS gives you the zone resilience of ZRS and the regional protection of GRS together, at higher cost. Add read access (RA-GRS or RA-GZRS) if your app must read from the secondary during an outage.
Take quiz
LRS in one datacenter
ZRS across three availability zones
GRS across two regions
LRS
ZRS
RA-GRS
24. What is the difference between block, append, and page blobs?
| Block blob | Append blob | Page blob | |
| Write pattern | Upload or replace blocks | Add to end only | Random page writes |
| Unit | Block (up to 4,000 MiB) | Block (up to 4 MiB) | 512-byte page |
| Max size | ~190.7 TiB | ~195 GiB | 8 TiB |
| Typical use | Files, media, backups | Logs, audit trails | VHD disks |
| Access tiers | Supported | Not supported | Not supported |
The practical rule: block blob for general data, append blob when you only add records, page blob when something needs in-place random writes. Only block blobs can use Hot, Cool, Cold and Archive tiering.
Take quiz
append blob
page blob
block blob
block blob via Append Block
page blob
append blob
25. What is the difference between SAS tokens and access keys?
An access key is a full-power secret for the entire account. A SAS is a derived token with a narrow scope and an expiry.
| Access key | SAS token | |
| Scope | Entire account | Chosen resource and permissions |
| Lifetime | Until regenerated | Until its expiry time |
| Revocation | Regenerate the key | Delete the stored policy or rotate the signing key |
| Identity | Anonymous to audit logs | Anonymous (unless user delegation) |
Hand out SAS tokens to clients, never the key. Even better, use Entra ID roles for your own apps and user delegation SAS for external parties, since both tie access back to an identity.
Take quiz
it is limited in permissions, resource and time
it cannot be copied or reused
it is encrypted with a customer key
delete the container's metadata
disable blob versioning
regenerate the signing account key
26. What is the difference between Blob Storage and Azure Files?
Blob Storage is object storage accessed mainly through REST APIs and SDKs. Azure Files offers managed file shares you mount like a network drive using SMB or NFS.
| Blob Storage | Azure Files | |
| Model | Objects in containers | Files and folders in shares |
| Access | REST, SDK, CLI, HTTP | SMB, NFS, REST |
| Best for | Media, backups, data lakes, web content | Lift-and-shift apps, shared folders |
| Scale | Very large, massively parallel | Share-sized, file-system semantics |
If a legacy app expects a drive letter or a mounted path, Azure Files fits. If you are building a cloud-native app that serves or processes objects, use Blob Storage.
Take quiz
Blob Storage with page blobs
Azure Files
Blob Storage Archive tier
Blob Storage
Azure Files with NFS
Azure Queue Storage
27. Why should you use a user delegation SAS?
A user delegation SAS is signed with a key obtained using Microsoft Entra credentials, not with the storage account key. That means the token can never exceed the permissions of the identity that created it, and no account key is exposed.
It also leaves a better audit trail and is easier to cut off: you can revoke the user delegation key, or remove the identity's role, and all tokens derived from it stop working. The delegation key lasts at most 7 days.
The caller needs the Storage Blob Delegator role (or equivalent) to request the key. The limitation is that it works for Blob and Data Lake storage only.
Take quiz
the storage account key1
a customer-managed key in Key Vault
a user delegation key obtained with Entra credentials
Storage Account Contributor only
Storage Blob Delegator
Reader
28. How does blob lifecycle management work?
Lifecycle management is a rule engine at the storage account level. You define JSON rules with filters (container, blob prefix, blob type, index tags) and actions based on days since modification, creation or last access.
{ "rules": [{ "name": "age-out-logs", "enabled": true, "type": "Lifecycle", "definition": { "filters": { "blobTypes": ["blockBlob"], "prefixMatch": ["logs/"] }, "actions": { "baseBlob": { "tierToCool": { "daysAfterModificationGreaterThan": 30 }, "tierToArchive": { "daysAfterModificationGreaterThan": 180 }, "delete": { "daysAfterModificationGreaterThan": 365 } } } } }] }
Rules run once a day and can tier, delete, or clean up old versions and snapshots. Changes may take up to a day to take effect.
Take quiz
age conditions such as days since modification, creation or last access
the size of the storage account
the geographic location of the client
resize page blobs and merge append blobs
change the account redundancy setting
move blobs between tiers and delete them
29. How do you rehydrate a blob from the Archive tier?
An archived blob is offline, so you must bring it back to an online tier before reading it. There are two ways:
- Set Blob Tier - change the same blob to Hot, Cool or Cold in place.
- Copy Blob - copy the archived blob to a new blob in an online tier, leaving the archive copy untouched.
You also pick a rehydration priority. Standard can take up to 15 hours. High priority is usually under an hour for objects smaller than 10 GB, but costs more. Copying is safer if you want to keep the archived original and avoid early-deletion issues.
Take quiz
Standard
Low
Cool-first
High
copy the blob to a new blob in an online tier
Set Blob Tier to Hot
delete and re-upload the blob
30. How does blob leasing work?
A lease puts a lock on a blob or container so only the holder of the lease ID can write to or delete it. Reads are still allowed. It is the simplest way to prevent two processes from modifying the same blob at once.
You acquire the lease with a duration of 15 to 60 seconds, or infinite. A finite lease must be renewed before it expires, otherwise it lapses. The lease can also be changed, released by the holder, or broken by an administrator.
Writes without the correct lease ID fail with a 412 error.
Take quiz
1 to 24 hours
5 to 10 minutes
15 to 60 seconds
nothing at all, even reads fail
read it, but not write or delete it
write freely but not delete
31. What is the difference between soft delete and versioning?
Both protect against mistakes, but they work differently. Soft delete keeps deleted or overwritten data for a limited retention window. Versioning keeps every previous state of a blob for as long as you keep the versions.
| Soft delete | Versioning | |
| Triggered by | Delete or overwrite | Every write or delete |
| Retention | 1-365 days, then purged | Until you delete versions or lifecycle removes them |
| Granularity | Recover the deleted blob | Pick any earlier state |
| Needed for | Basic accident recovery | Object replication, point-in-time restore |
Most production accounts enable both, plus a lifecycle rule to prune old versions.
Take quiz
blob versioning
blob soft delete alone
container soft delete
versioning
snapshots
soft delete
32. How do you secure data in Azure Blob Storage?
Security is layered, so use several controls together:
- Identity - prefer Microsoft Entra ID with RBAC roles, and disable shared key access where possible.
- Network - restrict traffic with the storage firewall, service endpoints or private endpoints.
- Transport - require HTTPS (secure transfer) and set a minimum TLS version.
- Anonymous access - disable blob public access at the account level unless you truly host public content.
- Encryption - on by default, optionally with customer-managed keys.
- Protection - soft delete, versioning, immutability and resource locks.
Add Microsoft Defender for Storage and diagnostic logging to detect abuse.
Take quiz
setting the Hot tier as default
disabling blob public access on the storage account
enabling object replication
HTTPS-only connections
encryption with customer-provided keys
private endpoint usage
33. How does Azure Storage encrypt data at rest?
All data written to Azure Storage is encrypted automatically with 256-bit AES (Storage Service Encryption). It cannot be turned off, and decryption is transparent to the caller.
By default the keys are Microsoft-managed. You can switch to customer-managed keys held in Azure Key Vault or Managed HSM, giving you control over rotation and revocation. Encryption scopes let you apply different keys per container or blob, and clients can also send a customer-provided key on each request.
For compliance needs, optional infrastructure encryption adds a second layer of encryption with a separate key.
Take quiz
Microsoft-managed keys
SAS signing keys
customer-managed keys
Yes, per container
No, it is always on
Yes, but only for Cool tier
34. How do you authorize access using Microsoft Entra ID?
Assign an Azure RBAC data role to the user, group or managed identity at the account, container or subscription scope. Common roles are Storage Blob Data Reader, Storage Blob Data Contributor and Storage Blob Data Owner.
The app then authenticates with Entra ID, for example through DefaultAzureCredential, and sends a bearer token with each request. No secrets are stored in the app when a managed identity is used.
A common trap: management roles like Owner or Contributor do not grant access to blob data. You must assign one of the data roles, and propagation can take a few minutes.
Take quiz
Storage Blob Data Reader
Contributor
Storage Account Contributor
Owners cannot use Entra ID with storage
blobs need a separate subscription
management roles do not include data-plane permissions
35. When should you use a private endpoint for Blob Storage?
Use a private endpoint when traffic to the account must stay on your virtual network and never touch the public internet. It gives the storage account a private IP address inside your VNet, and you can then turn off public network access entirely.
It is the right choice for regulated data, hybrid setups where on-premises networks connect through VPN or ExpressRoute, and when you need to block data exfiltration. You also need a private DNS zone (privatelink.blob.core.windows.net) so the account name resolves to the private IP.
A service endpoint is simpler and free, but the account keeps its public IP and cannot be reached from on-premises over private links.
Take quiz
a dedicated public IP address
a private IP address inside your virtual network
a custom domain with free TLS
privatelink.blob.core.windows.net
blob.core.windows.net.local
privatelink.file.core.windows.net
36. How does object replication work?
Object replication asynchronously copies block blobs from a container in a source account to a container in a destination account, which may be in another region or subscription. You define it with a policy containing one or more rules, each optionally filtered by blob prefix.
Prerequisites: blob versioning on both accounts and change feed on the source account. New writes and deletes after the policy is created are replicated, and the destination is meant to be treated as read-only.
Typical uses are reducing read latency for users in another region and keeping a copy for compliance or analytics.
Take quiz
soft delete on the source and immutability on the target
Archive tier and lifecycle management
versioning on both accounts and change feed on the source
page blobs
block blobs
append blobs
37. How does immutable storage work in Blob Storage?
Immutable storage provides WORM (write once, read many) protection. Blobs can be created and read, but not modified or deleted for as long as the policy applies.
There are two mechanisms. A time-based retention policy blocks changes for a set number of days. A legal hold blocks changes until the hold is cleared, with no end date. Both can be applied at container level or at the individual version level.
Once a time-based policy is locked, it cannot be removed and the retention period can only be extended. This is what satisfies regulations like SEC 17a-4.
Take quiz
it cannot be deleted and retention can only be extended
it can be removed by any Contributor
the blobs move to the Archive tier
it only applies to append blobs
it encrypts the data with a second key
it has no fixed expiry and stays until explicitly cleared
38. What is the difference between blob metadata and index tags?
Both attach key-value pairs to a blob, but they serve different purposes.
| Metadata | Index tags | |
| Searchable | No, you must read the blob properties | Yes, via Find Blobs by Tags |
| Limit | 8 KB total per blob | Up to 10 tags per blob |
| Authorization | Same as the blob | Separate tag permissions |
| Use in lifecycle rules | No | Yes, as a filter |
Use metadata for descriptive information that travels with the blob, and tags when you need to find or filter blobs across containers without listing everything.
Take quiz
blob metadata
blob index tags
container ACLs
up to 10
up to 100
only 1
39. How do you host a static website in Blob Storage?
Enable the static website feature on the storage account, then upload your HTML, CSS, JavaScript and images to the special $web container.
- Enable static website hosting in the portal or CLI.
- Set the index document name (for example
index.html) and an optional error document. - Upload files to
$web. - Browse to the primary web endpoint, which looks like
https://myaccount.z13.web.core.windows.net.
az storage blob service-properties update \ --account-name shopsite --static-website \ --index-document index.html --404-document 404.html
The web endpoint differs from the normal blob endpoint. For a custom domain with HTTPS, put Azure Front Door or Azure CDN in front.
Take quiz
$root
$static
$web
rename the container to the domain name
place Azure Front Door or Azure CDN in front
upload a certificate file into $web
40. How do Event Grid blob events work?
When blobs are created or deleted, the storage account publishes events like BlobCreated and BlobDeleted to Azure Event Grid. Event Grid then pushes them to subscribers such as Azure Functions, Logic Apps, Event Hubs, Storage Queues or a webhook.
flowchart LR A["Client uploads blob"] --> B["Storage account"] B -->|BlobCreated event| C["Event Grid topic"] C --> D["Azure Function"] C --> E["Storage Queue"] C --> F[Webhook]
Events carry metadata (blob URL, content type, size) but not the blob content itself. This push model replaces polling and lets you build reactions like image resizing or virus scanning without running a server.
Take quiz
details about the blob such as its URL and size, not the content
the full blob content
only the storage account key
it moves blobs between tiers automatically
it removes the need for any storage account
subscribers are notified immediately without constant listing
41. Explain the internal working of block blob uploads?
A large block blob upload is a two-phase process. First the client stages data as uncommitted blocks, then it commits them as the blob with a block list. Nothing is visible to readers until the commit succeeds.
sequenceDiagram participant C as Client participant S as Blob service C->>S: Put Block (ID=1, data) C->>S: Put Block (ID=2, data) C->>S: Put Block (ID=3, data) Note over S: Blocks held as uncommitted C->>S: Put Block List (1,2,3) S-->>C: 201 Created + ETag
- Split the file into blocks (up to 4,000 MiB each, up to 50,000 per blob).
- Give each block a unique, same-length Base64 block ID and send it with Put Block, in parallel if you like.
- Call Put Block List naming the IDs in the order they should appear. Each ID can be taken from the committed, uncommitted or latest set.
- The service atomically replaces the blob's content and returns a new ETag.
Uncommitted blocks that are never committed are garbage collected after a week. Because a failed block can simply be re-sent, uploads are resumable, and you can also update a blob by committing a list that reuses old block IDs plus a few new ones.
Take quiz
as soon as the first Put Block succeeds
after Put Block List commits the blocks
after the next lifecycle management run
they are garbage collected after about a week
they are auto-committed in ID order
they stay forever and count as a snapshot
the service restarts the upload automatically from byte zero
page blobs are used internally as a buffer
already staged blocks are kept and only missing blocks are re-sent
42. How does optimistic concurrency with ETags work in Blob Storage?
Every blob has an ETag that changes whenever the blob is modified. Optimistic concurrency uses it to detect conflicting writes without locking anything.
The client reads the blob and remembers the ETag. When writing back, it sends a conditional header If-Match: <etag>. If the blob changed in the meantime, the ETag no longer matches and the service answers 412 Precondition Failed, so the client re-reads, merges and retries.
var conditions = new BlobRequestConditions { IfMatch = props.Value.ETag }; try { await blob.UploadAsync(stream, conditions: conditions); } catch (RequestFailedException e) when (e.Status == 412) { // someone else updated it, reload and retry }
If-None-Match: * does the opposite: it makes the write succeed only if the blob does not exist, giving you a safe create-only operation. Use leases instead when you want pessimistic locking, for example a single leader-election worker.
Take quiz
404 Not Found
409 Conflict on container
412 Precondition Failed
the write overwrites any existing blob
the write succeeds only if the blob does not already exist
the blob is encrypted before upload
when you need an exclusive lock held for a period
when you want to avoid HTTP headers entirely
when blobs are in the Archive tier
43. How do you troubleshoot 403 errors in Blob Storage?
A 403 means the request was understood but rejected. The error code in the response body tells you which layer refused it, so start there.
| Error code | Likely cause | Fix |
AuthorizationFailure |
Storage firewall or VNet rule blocked the caller | Add the IP, subnet or private endpoint |
AuthorizationPermissionMismatch |
Entra identity lacks a data role | Assign Storage Blob Data Reader/Contributor, wait for propagation |
AuthenticationFailed |
Bad SAS signature, expired token or clock skew | Regenerate the SAS, check start/expiry and clock |
KeyBasedAuthenticationNotPermitted |
Shared key access is disabled | Use Entra ID or user delegation SAS |
PublicAccessNotPermitted |
Anonymous access disabled at account level | Authenticate, or deliberately re-enable public access |
Then confirm the basics: you assigned a data role and not just Contributor, the SAS permissions match the operation, and the request comes through the expected network path. Enable diagnostic logs to see the caller, auth type and exact failure reason.
Take quiz
AuthorizationFailure
AuthorizationPermissionMismatch
PublicAccessNotPermitted
regenerate the access keys
enable static website hosting
assign a data role such as Storage Blob Data Reader
the blob's access tier
the token's start time, expiry and signature, including clock skew
the container's soft delete retention
44. How do you troubleshoot 503 Server Busy errors in Blob Storage?
A 503 ServerBusy (or 500 OperationTimedOut) means the account or a single partition has hit a scalability target and the service is throttling you. It is a signal to slow down and spread load, not usually a service outage.
- Check metrics in Azure Monitor: transactions, ingress/egress, and throttling responses by API and by time.
- Retry with exponential backoff. The Azure SDK retry policy does this by default, so make sure it was not disabled.
- Avoid hot partitions. Blob partitions are range-based on account, container and blob name, so names that increase sequentially (such as timestamp prefixes) push all traffic to one partition. Add a hash or random prefix to spread writes.
- Spread the load over time, reduce tiny requests by batching, or split across multiple storage accounts or containers if you are at account limits.
- Verify the client is not in a retry storm that multiplies traffic.
If a workload truly needs higher limits, you can request a quota increase for some limits or move to a Premium block blob account.
Take quiz
names with a random hash prefix
sequential names such as increasing timestamp prefixes
names that contain no slashes
retry with exponential backoff
retry instantly in a tight loop
switch the blob to the Archive tier
the lifecycle management policy
the account's SAS token expiry
Azure Monitor metrics for transactions and throttled responses
45. How can you optimize large blob upload and download performance?
Throughput depends on parallelism, block size, and network distance. Tuning these usually matters more than the service itself.
- Parallel transfers - upload many blocks at once. In the .NET SDK set
StorageTransferOptions(MaximumConcurrency,MaximumTransferSize). With AzCopy, raiseAZCOPY_CONCURRENCY_VALUE. - Right-sized blocks - larger blocks (for example 8-100 MiB) mean fewer requests for big files, while smaller blocks recover faster from errors.
- Stay close - run compute in the same region as the account, and use Private Link or ExpressRoute for predictable bandwidth.
- Range reads - download only the byte ranges you need and fetch ranges in parallel.
- Avoid tiny files - bundle small objects, because per-request overhead dominates.
- Spread partitions - avoid sequential name prefixes for very high request rates.
For server-to-server copies use Put Blob From URL or AzCopy's service-side copy, so bytes do not travel through your client at all. Measure before and after, since the bottleneck may be your disk or network rather than Azure.
Take quiz
downloading to a local disk then re-uploading
zipping blobs into a page blob
service-side copy such as Put Blob From URL or AzCopy server-to-server
BlobHttpHeaders.CacheControl
StorageTransferOptions.MaximumConcurrency
BlobContainerClient.GetAccessPolicy
it reduces latency and avoids cross-region bandwidth limits and charges
it removes the need for authentication
it doubles the block size limit
46. Explain how account failover works with RA-GRS?
With RA-GRS, writes go to the primary region and are copied asynchronously to the secondary. Between failovers, your app can read from the read-only -secondary endpoint, for example https://shopdata-secondary.blob.core.windows.net.
In a regional disaster you (or Microsoft) can trigger an account failover. The secondary is promoted to primary, the DNS endpoints are repointed, and the account typically becomes LRS in its new region until you re-enable geo-redundancy.
flowchart LR A["App writes"] --> B["Primary region"] B -->|async copy| C["Secondary region"] A -.reads on outage.-> C B -. failover .-> D["Secondary becomes primary"]
Because replication is asynchronous, anything not yet copied is lost on failover. Check the account's Last Sync Time to know your exposure. Replication lag is typically small but not guaranteed by default. Design apps to fall back to the secondary for reads, and to tolerate stale data there.
Take quiz
the point before which all primary writes are guaranteed to exist in the secondary
when the account key was last rotated
the last time a lifecycle rule ran
failover deletes blobs older than 7 days
the secondary only copies Hot tier blobs
geo-replication is asynchronous, so unreplicated writes are not in the secondary
by writing to the secondary using the same URL
by calling the -secondary endpoint, which is read-only
by using the dfs endpoint only
47. What happens when you overwrite a blob with versioning enabled?
With versioning enabled, an overwrite never destroys the old content. The service takes the existing blob and stores it as a previous version, identified by a version ID that is the timestamp of its creation. The newly written data becomes the current version with its own version ID.
A delete behaves similarly: the current version turns into a previous version, and the blob name has no current version, so a normal GET returns 404 until you restore one.
| Action | Result |
| Upload over existing blob | Old content becomes a previous version, new content is current |
| Delete the blob | Current becomes previous, no current version remains |
| Read with versionId | Returns that specific historical version |
| Restore | Copy a previous version over the current blob (creates another version) |
Every version is billed as stored data, but identical blocks are shared, so only changed blocks add cost. Add a lifecycle rule to delete old versions, otherwise storage grows without limit. Versions can be deleted individually, even while the current version remains.
Take quiz
it is moved to the Archive tier automatically
it is kept as a previous version with its own version ID
it is permanently removed after 24 hours
404 because there is no current version
the most recent previous version
the blob from the secondary region
turn off HTTPS
set the account to Premium
a lifecycle rule that deletes previous versions after N days
48. How does point-in-time restore work for block blobs?
Point-in-time restore (PITR) rolls block blobs in one or more containers back to an earlier state, for example just before a bad deployment or a ransomware event. It works by replaying the change feed backwards and using versions and soft delete to recover data.
- Enable soft delete, change feed and versioning on the account.
- Enable point-in-time restore and choose a retention period. It must be shorter than the soft delete retention period.
- Start a restore for a chosen UTC time, for all containers or specific blob ranges.
Only block blobs in standard general-purpose v2 accounts are restored. Page and append blobs are not affected, and a restore is blocked if there are conflicting immutability rules. The operation is asynchronous, and blobs written after the restore point are reverted.
PITR is a recovery tool for logical corruption, not a replacement for geo-redundancy or a separate backup.
Take quiz
object replication and static website
Archive tier and immutability policy
soft delete, change feed and versioning
all three blob types
block blobs only
append blobs only
it must be shorter than the soft delete retention period
it must equal the lifecycle deletion age
it must be longer than 365 days
49. When would you choose Premium block blob storage?
Choose a Premium block blob account when the workload is dominated by many small, latency-sensitive operations and you care about consistently low latency. It runs on SSD-based hardware, so request latency is lower and more predictable than Standard.
Good fits include interactive web and mobile back ends, AI and machine learning pipelines that read lots of small files, IoT telemetry ingestion, and analytics steps with heavy small-file I/O.
| Standard (Hot) | Premium block blob | |
| Media | HDD-based | SSD-based |
| Latency | Variable | Low and consistent |
| Storage cost | Lower | Higher |
| Transaction cost | Higher | Lower |
| Redundancy | LRS to GZRS | LRS or ZRS only |
| Access tiers | Hot/Cool/Cold/Archive | None |
If you mostly store large files and read them rarely, Standard with tiering is cheaper. The break-even depends on how many transactions you run per GB stored.
Take quiz
many small reads and writes needing low, consistent latency
rarely accessed compliance archives
multi-year cold backups
GRS and RA-GZRS
all six standard options
LRS and ZRS only
lower storage cost and higher transaction cost
higher storage cost but lower per-transaction cost
no charge for storage at all
50. How can you optimize Azure Blob Storage costs?
Cost has four drivers: capacity, transactions, data transfer and extra copies. Attack each one in turn.
- Right tier - use lifecycle rules to move aging data from Hot to Cool, Cold and Archive, and watch the 30/90/180-day minimums to avoid early deletion charges.
- Clean up - delete old versions, snapshots and incomplete uploads, which silently grow the bill.
- Right redundancy - do not pay for GZRS on easily reproducible data, but do not cut it from critical data.
- Watch transactions - lots of small writes or frequent listings add up, and reads from cooler tiers cost more per operation. Batch small files.
- Limit egress - keep compute in the same region and use a CDN for popular content.
- Commit - reserved capacity for 1 or 3 years lowers the price for predictable volumes.
Use Azure Cost Management and storage metrics to see where spend comes from. Archive is cheapest to store but the most expensive to read, so never archive data you may need quickly.