Skip to content
VG
← Learn Azure

Learn Azure · Part 3 · Basics

Storage accounts, blobs and access keys (and why your Owner role can't read your own files)

· 11 min read

For learning only. General guidance and my own views, not official Microsoft advice and not tied to any employer or client. Read the full note.

View the slides

In post 2 we put a web app on the internet. Almost every app also needs somewhere to keep files: images, uploads, backups, logs. In Azure, that place is a storage account.

This post creates one, puts a file in it, and then works through the three ways to reach that file. Two of them use keys, and one of them is the way you should actually use. Along the way you’ll hit an error that surprises nearly everyone: as the subscription Owner, you’re still not allowed to see your own files.

By the end you will have:

  • a storage account with sensible, low-cost settings,
  • a private container with a file in it,
  • shared the file with a time-limited link, then broken that link on purpose,
  • given yourself the right role to read data without any key,
  • deleted everything, for well under a cent.

1. What a storage account is

A storage account is one resource that gives you four kinds of storage under a single name:

ServiceWhat it storesTypical use
BlobsFiles of any kind (“binary large objects”)Images, documents, backups, static websites
FilesNetwork file shares (SMB/NFS)Replacing an on-premises file server
QueuesSmall messagesPassing work between parts of an app
TablesSimple key-value rowsCheap, schema-less data

This post is about blobs, which are by far the most common. Blobs live in containers, which work like top-level folders:

storage account   stlearnazurevgdev
└── container     documents
    └── blob      hello-blob.txt

Every blob gets its own web address:

https://stlearnazurevgdev.blob.core.windows.net/documents/hello-blob.txt

Whether that address works for someone is what the rest of this post is about.

2. Create the storage account

Search for Storage accounts and select Create. On the Basics tab:

  • Resource group: rg-learnazure-dev-eus
  • Storage account name: stlearnazure<yourinitials>dev. It must be 3 to 24 characters, lowercase letters and numbers only, and unique across all of Azure, because it becomes part of a public web address.
  • Region: East US
  • Primary service: Azure Blob Storage or Azure Data Lake Storage

Primary workload: a new shortcut

The portal now asks for a Primary workload and pre-fills settings to match it:

The Primary workload list: AI Agent inferencing, Fine tune a model, Big Data Analytics, Backup and archive, and General purpose

Choose General purpose. The others are fine choices for those jobs, but they change defaults you should understand first.

Redundancy: the setting that doubles your bill

Leave Performance on Standard. Then look at Redundancy. For General purpose, Azure pre-selects Geo-redundant storage (GRS) with read access ticked, which is RA-GRS:

Performance Standard; Redundancy pre-set to Geo-redundant storage with read access to the secondary region ticked, and "RA-GRS is recommended"

Redundancy decides how many copies Azure keeps and where:

The redundancy options: LRS, GRS, ZRS and GZRS, each with a short description

OptionCopiesSurvivesRelative cost
LRS, locally redundant3, in one datacenterA failed disk or serverLowest
ZRS, zone-redundant3, across availability zonesA whole datacenter going downHigher
GRS / RA-GRS, geo-redundant6, in two regions far apartA whole region going downAbout double LRS
GZRS / RA-GZRS6, zones plus a second regionBoth of the aboveHighest

For learning, and for anything you could recreate, choose Locally redundant storage (LRS). For important production data, a geo-redundant option is worth paying for. It’s a business decision, not a default to accept without thinking.

Advanced: access tier

On the Advanced tab, leave the Access tier on Hot:

Access tier: Hot, Cool and Cold, with descriptions

TierStorage costReading costMinimum stay
HotHighestLowestNone
CoolLowerHigher30 days
ColdLower stillHigher still90 days
Archive (per blob only)LowestHighest, and hours to retrieve180 days

Moving or deleting a blob before its minimum stay still bills the remaining days. For files you use every day, Hot is cheapest overall.

Security: two settings to notice

The Security tab has the settings this post is really about:

Security tab: secure transfer required, anonymous access off, storage account key access on, Entra authorization in the portal off, minimum TLS 1.2

  • Allow enabling anonymous access on individual containers: off. Good. Nobody can read your files without credentials.
  • Enable storage account key access: on. This means two powerful keys exist for this account. We’ll see what they can do in section 5.

Also check that Enable Defender for Storage, further down, is unticked. It’s a paid add-on.

Select Review + create. The summary confirms that you changed the recommended redundancy:

Review page: LRS selected, with the note "Redundancy: LRS (Recommended: RA-GRS)"

Select Create. It takes about 30 seconds.

What it costs: an empty storage account costs nothing. You pay for the data stored (around 2 US cents per GB per month for Hot LRS at the time of writing) and for each read and write, which costs fractions of a cent per 10,000 operations. A few small test files cost effectively nothing.

3. Tour the account

Select Go to resource:

Storage account overview: Standard, LRS, StorageV2, with Blob service and Security properties

A few properties worth a glance:

  • Blob anonymous access: Disabled, as chosen.
  • Blob soft delete: Enabled (7 days). Deleted blobs can be recovered for a week. That’s a free safety net, so leave it on.
  • Storage account key access: Enabled. Remember this one.

4. Create a container and upload a file

Under Data storage → Containers, select + Add container and name it documents. The access level is locked to Private, because anonymous access is off for the whole account:

New container panel: name documents, access level Private (no anonymous access) and greyed out

Select Create. Then open the container, select Upload, and choose any small file. I used a two-line text file called hello-blob.txt:

Upload blob panel with hello-blob.txt selected for the documents container

After the upload, the file shows in the list:

The documents container showing hello-blob.txt, Hot tier, 91 bytes, with "Authentication method: Access key"

Notice the line above the list: Authentication method: Access key. The portal itself is reading your files with the account key. Keep that in mind.

5. Three ways to reach a blob

Way 1: just open the URL (blocked)

Copy the blob’s URL from its Overview and open it in a new browser tab:

Browser showing a PublicAccessNotPermitted error for the blob URL

PublicAccessNotPermitted. That’s exactly what you want. The URL is public; the data is not.

A shared access signature (SAS) is a URL with a signed permission slip on the end: read only, this file only, until 8 PM, over HTTPS only. Open the blob, select Generate SAS:

Generate SAS form: signing method Account key, Key 1, permissions Read, start and expiry times, HTTPS only

Select Generate SAS token and URL. Azure gives you a token and the full link:

The generated Blob SAS token and Blob SAS URL, blurred

Open the Blob SAS URL in a new tab, and the file appears:

The SAS URL showing the text of hello-blob.txt in the browser

That’s useful for sharing one file with someone for a few hours. But look at the form again: Signing method: Account key, Signing key: Key 1. The link is only as trustworthy as the key that signed it.

What an access key really is

Open Security + networking → Access keys:

Access keys page showing key1 and key2 hidden, each with Show and Rotate key

Each storage account has two keys. Either one gives full control of every piece of data in the account: read, write and delete everything, forever, from anywhere, with no sign-in and no record of who used it. It’s a master password that doesn’t expire.

There are two so you can swap them without downtime: move your apps to key2, rotate key1, and the reverse next time. Let’s rotate key1 now:

Regenerate access key warning: "The current key will become immediately invalid and is not recoverable"

Select Yes, then refresh the tab with your SAS link:

The SAS URL now returns AuthenticationFailed: Signature did not match

AuthenticationFailed: Signature did not match. Every SAS link signed with key1 died the moment the key changed. So did every app, script or colleague using key1.

That shows the two problems with keys:

  1. If a key leaks, everything leaks. One key in a public GitHub repo, a screenshot or a config file exposes the whole account.
  2. Fixing a leak breaks things. Rotating the key cuts off everyone using it, the good and the bad, all at once.

Way 3: sign in as yourself (the right way)

Go back to the container and select Switch to Microsoft Entra user account. The portal stops using the key and uses your identity instead:

Error: "You do not have permissions to list the data using your user account with Microsoft Entra ID", and No items found

You do not have permissions to list the data. You’re the Owner of the whole subscription, so why?

Azure separates two kinds of permission:

KindControlsExample roles
Management (control plane)Creating, configuring and deleting resourcesOwner, Contributor, Reader
Data (data plane)Reading and writing the contentsStorage Blob Data Reader, Contributor, Owner

Owner lets you manage the storage account, including reading its keys, which is how the portal showed your files before. It doesn’t by itself give you access to the data. That separation is deliberate: the person who runs the infrastructure doesn’t automatically see what’s stored in it.

Give yourself a data role. Open the storage account’s Access control (IAM) → Add → Add role assignment and search for Storage Blob Data:

Add role assignment: Storage Blob Data Contributor, Owner and Reader listed, with Contributor selected

RoleCan
Storage Blob Data ReaderRead and list
Storage Blob Data ContributorRead, write and delete
Storage Blob Data OwnerAll of the above, plus manage access settings on the data

Choose Storage Blob Data Contributor, select Next, add yourself under Members, and review:

Review + assign: role Storage Blob Data Contributor, scoped to this one storage account, member Viki Gandhi

Notice the Scope: this one storage account, not the whole subscription. Always grant the smallest scope that does the job.

Select Review + assign. Role changes can take a few minutes to reach storage; mine took about 90 seconds. Refresh the container:

The documents container listing hello-blob.txt with "Authentication method: Microsoft Entra user account"

The file is back, and no key was involved. Access is now:

  • tied to a person, and every access is logged against their name,
  • revocable for one person without breaking anyone else,
  • protected by sign-in, including multi-factor authentication.

Apps get the same benefit through managed identities, which we’ll cover later in the series. Once everything uses Entra, you can turn storage account key access off entirely and the master keys stop working.

Rule of thumb: use Microsoft Entra roles by default. Use a short-lived SAS when you must share with someone outside your organization; prefer a user delegation SAS, which is signed with your Entra identity rather than an account key. Treat account keys as an emergency tool, never as a way to hand out access.

6. Clean up

Delete the storage account. It removes the containers, blobs and role assignment with it:

az storage account delete -n stlearnazure<yourinitials>dev -g rg-learnazure-dev-eus --yes

Or use Delete on the account’s Overview page and type its name to confirm. Keep the empty resource group for the next post.

My whole session cost well under one cent.

Quick check

1. Azure pre-selects RA-GRS for a general-purpose account. When is LRS the better choice? When you could recreate the data or losing a region is an acceptable risk: learning, testing, caches and copies. LRS costs roughly half as much. Pay for geo-redundancy when the data is important and irreplaceable.

2. You rotate key1. What happens to SAS links that were signed with it? They stop working immediately with “Signature did not match”, as do any apps using key1. Links signed with key2 keep working.

3. You’re the subscription Owner but can’t list blobs when the portal uses your Entra account. Why? Owner is a management role. Reading blob contents needs a data role such as Storage Blob Data Reader or Contributor, assigned at a scope that includes the account.

4. Why is an account key riskier than a role assignment? A key gives full access to all data in the account, never expires, isn’t tied to a person, and can’t be revoked for one user without breaking everyone else who uses it.

What’s next

Level 1, post 4: Reading your bill before it surprises you. We’ll open Cost analysis, find what the last three posts actually cost, and set up views that make a surprise charge easy to spot.

Further reading

Share LinkedInXEmail

Questions or stuck on a step?

Send me a note. Good questions often become the next post. For architecture work or speaking, the same form reaches me.

Contact me

Comments and reactions

Sign in with GitHub to comment or react. Questions about the post are very welcome.