Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Azure Storage Accounts
Azure Storage keeps data in the cloud.
- A storage account is the top-level container for your data.
- GPv2 accounts hold blobs, files, queues, and tables.
- Blob Storage is for unstructured data like images and logs.
- Data Lake Storage Gen2 is for big data and uses folders.
- Azure has three access tiers: Hot, Cool, and Archive.
- Hot is for data you use often. Archive is for long-term data.
- Redundancy means keeping more than one copy of the data.
- LRS keeps copies in one region. GRS keeps copies in two regions.
- Lifecycle policies move old data to cheaper tiers.
- Role-Based Access Control (RBAC) decides who can use the account.
- The account name must be unique in all of Azure.
In more detail
- To create an account, pick a subscription, a resource group, and a region. Then pick a performance tier: Standard or Premium.
- Then pick redundancy. LRS is the cheapest. GZRS gives the most copies.
- In the advanced settings, choose public or private access. Firewall rules can limit IPs.
- Encryption is on by default with Microsoft keys. You can use your own keys instead.
- Turn on soft delete, so you can restore deleted blobs and file shares.
- For access, give people the smallest role. Reader can only look. Contributor can manage the account but cannot read the keys. Owner has full control.
- Lifecycle rules can move blobs from Hot to Cool or Archive. They can also delete old blobs. This is a big way to cut cost.
- Check the cost reports and remove unused premium accounts. Azure Monitor shows usage and performance for the account.
Azure Storage: Blobs, Files, and Queues
Blobs store files. They are good for images, video, and backups.
- A container holds a group of blobs.
- A container can be private, or open for public read.
- File shares work with SMB and NFS.
- You can mount a file share on Windows or on Linux.
- A file share has a quota, so it cannot grow without a limit.
- Queue Storage sends messages between parts of an app.
- A queue message can have a time-to-live (TTL).
- SAS and Microsoft Entra ID control access.
- Lifecycle rules and soft delete cut cost and risk.
In more detail
- To use blobs, make a storage account. Then open Blob Service and create a container. Upload files with the portal, Storage Explorer, the CLI, or the API.
- Keep containers private by default. Public access can leak data.
- To use file shares, open File Service and create a share. Set the name and the quota.
- Then map the share. On Windows you use
net use. On Linux you usemount. - Use a share for shared documents. It helps when you move an old file server to Azure.
- To use a queue, create the queue and set message settings like TTL. One service writes a message. Another service reads it later. This is async work.
- Watch the queue depth. If it grows, the workers are too slow. Add retry logic for failed messages, and alerts when the queue is too full.
- Use SAS tokens for short, limited access. Use RBAC for people and apps. Turn on soft delete, so a wrong delete can be undone.
Azure Storage Security and Encryption
Azure encrypts storage data at rest by default.
- This default encryption is called server-side encryption (SSE).
- You can use Microsoft keys, your own keys, or keys you bring per request.
- Customer-managed keys live in Azure Key Vault.
- Data in transit is protected with TLS.
- Turn on "HTTPS only" to block plain HTTP.
- A Shared Access Signature (SAS) gives limited access for a short time.
- A SAS token has permissions, a start time, an end time, and IP limits.
- There are three SAS types: user delegation, service, and account.
- Keep tokens out of code and config files.
In more detail
- By default, Azure holds and rotates the keys. For strict rules, use customer-managed keys. You control the key and when it rotates.
- A customer-provided key is sent with each request. Azure does not keep it.
- Use HTTPS only on the storage account. This blocks man-in-the-middle attacks.
- To make a SAS, open the storage account and choose Shared Access Signature. Pick the allowed actions, like read only. Then set a short end time.
- Add an IP range, so the token works only from your network.
- A user delegation SAS uses Microsoft Entra ID. A service SAS covers one service and can use a stored access policy. An account SAS covers the whole account.
- Do not put tokens in scripts or config files. Use environment variables.
- Use Azure Monitor logs and Azure Policy to check access and to enforce HTTPS.
Optimizing Storage Performance with Azure Monitor
Azure Monitor shows how storage is doing.
- It tracks metrics and logs for every storage account.
- Latency shows how long a request takes.
- Transaction rate shows how many reads and writes happen.
- Capacity shows how much space you use.
- Queue depth shows how many messages are waiting.
- Diagnostic settings send logs to other services.
- Storage Insights shows many accounts in one view.
- Alerts warn you before a small problem gets big.
- Old data can move to a cheaper tier to save money.
In more detail
- Open the storage account and go to Diagnostic Settings. Add a setting and send logs and metrics to Log Analytics, an event hub, or a storage account.
- Then open Azure Monitor and choose Storage Accounts under Insights. This shows trends across your accounts.
- To make an alert, pick the account as the scope, set a condition, and choose an action group. An action group can send email, SMS, or a webhook call.
- A condition can be "latency is over 100 ms". High latency may mean throttling, network congestion, or too much load.
- If latency stays high, move to Premium storage or scale the resources.
- If capacity is near full, set an alert at 90 percent and scale before you hit the limit.
- Check data access patterns. Move old, rarely read data to Cool or Archive. Also watch bandwidth, so you do not pay for data you do not need to move.
- Alert on suspicious access too. Use private endpoints for sensitive data.
Key terms
The words of this course in one table. Learn them before the quiz or exam.
| Term | Meaning |
|---|---|
| Access tier | The price and speed level of blob data: Hot, Cool, Archive. |
| Account SAS | A SAS for the whole storage account. |
| Action group | The list of people or tools an alert notifies. |
| Alert rule | A rule that fires when a metric passes a limit. |
| Azure Monitor | The Azure service for metrics, logs, and alerts. |
| Blob | An object, like a file, kept in a container. |
| Container | A group of blobs in a storage account. |
| Customer-managed key | A key you own and control in Key Vault. |
| Data Lake Storage Gen2 | A storage type for big data with folders. |
| Diagnostic setting | A rule that sends logs and metrics to a destination. |
| Encryption at rest | Locking data while it sits on disk. |
| File share | A shared folder that uses SMB or NFS. |
| GPv2 | A general account type for blobs, files, queues, and tables. |
| GRS | Copies of data in a second Azure region. |
| GZRS | Zone copies plus a second region. |
| HTTPS only | A setting that blocks unencrypted HTTP access. |
| Key Vault | The Azure service that stores keys and secrets. |
| Lifecycle policy | A rule that moves or deletes data after some time. |
| Log | A record of an event, like a read request. |
| Log Analytics | A workspace where you query logs. |
| LRS | Three copies of data in one data center. |
| Metric | A number that changes over time, like latency. |
| Module 01 | Storage account, GPv2, access tier, LRS, GRS, GZRS, ZRS, RBAC. |
| Module 02 | Blob, container, file share, queue, queue depth. |
| Module 03 | Customer-managed key, SAS, HTTPS only, TLS, soft delete. |
| Module 04 | Queue depth, lifecycle policy, plus the Azure Monitor words. |
| NFS | A file sharing protocol used by Linux. |
| Queue | A list of messages that apps read in order. |
| Queue depth | The number of messages waiting in a queue. |
| Quota | The maximum size of a file share. |
| RBAC | Role-based access control for Azure resources. |
| SAS | A token that gives limited, time-based access. |
| Service SAS | A SAS for one storage service. |
| SMB | The file sharing protocol used by Windows. |
| Soft delete | A setting that keeps deleted data for a while. |
| SSE | Server-side encryption, done by Azure on the storage side. |
| Storage account | The top-level container for Azure Storage data. |
| Storage Insights | A view of storage health across many accounts. |
| Stored access policy | A saved set of rules that a service SAS can use. |
| Throughput | The amount of data moved in a period of time. |
| TLS | The protocol that encrypts data in transit. |
| TTL | The time a message stays in the queue before it expires. |
| User delegation SAS | A SAS signed with Microsoft Entra ID. |
| ZRS | Copies of your data across several availability zones. |
Check yourself
Answer each question first, then open it to check the answer.
1Which tier is best for data you open every day?
The Hot tier.
2What is the difference between LRS and GRS?
LRS keeps three copies in one region. GRS also keeps copies in a second region.
3Why should you use lifecycle policies?
They move old data to cheaper tiers or delete it, so you pay less.
4Which storage type is best for images and video?
Blob Storage.
5What happens to a queue message when its TTL ends?
It expires and is removed from the queue.
6Why should a blob container stay private?
Public access lets anyone read the data, so it can leak.
7Is storage data encrypted by default?
Yes, with server-side encryption.
8Which SAS type uses Microsoft Entra ID?
The user delegation SAS.
9Where should a SAS token never be kept?
In scripts or config files. Use environment variables instead.
10Which metric tells you that requests are slow?
Latency.
11Where can diagnostic logs go?
To Log Analytics, an event hub, or a storage account.
12What should you do when capacity reaches 90 percent?
Act before the limit: scale up or move old data to a cheaper tier.