The portal, the CLI, PowerShell, every SDK, Bicep and Terraform are all just different ways of sending the same HTTPS requests to one service: Azure Resource Manager. This part follows a single request from your machine to a running resource, separates managing a resource (the control plane) from using it (the data plane), and shows why an idempotent PUT of desired state is the idea Infrastructure as Code is built on.
This is the fourth part of the Azure series. Parts 2 and 3 described where resources live. This part is about how they come to exist, change and disappear, and it opens one of the biggest black boxes in the path: what actually happens when you click Create in the portal.
The answer is the same no matter which tool you use, and seeing that is the main point of the part. There is exactly one front door to manage anything in Azure, and every tool is a different way of knocking on it.
There are a lot of ways to create a storage account:
az storage account create in the Azure CLI;New-AzStorageAccount in Azure PowerShell;They look completely different, but they all do the same thing underneath: they turn your intent into an HTTPS request to a single service called Azure Resource Manager (ARM), at the address management.azure.com.
This design has consequences that make Azure much easier to reason about:
Here is what happens, step by step, when you run:
az storage account create --name stphotodropdev01 \
--resource-group rg-photodrop-dev --location westeurope --sku Standard_LRS1. The tool builds an HTTP request. The CLI turns the command into a PUT request whose URL is the resource ID from Part 2, plus an API version, and whose body is the resource's desired configuration as JSON:
PUT https://management.azure.com/subscriptions/9f1c2a7e-4b3d-4e8a-a1f0-6c2d5e9b7a14/resourceGroups/rg-photodrop-dev/providers/Microsoft.Storage/storageAccounts/stphotodropdev01?api-version=2023-05-01
Authorization: Bearer eyJ0eXAiOiJKV1Qi...
Content-Type: application/json
{
"location": "westeurope",
"sku": { "name": "Standard_LRS" },
"kind": "StorageV2"
}2. The tool attaches a token. The Authorization header carries an access token from Entra ID, obtained when you ran az login. The Azure Identity series covers how that token is issued; here it is enough that it proves who is making the request.
3. ARM authenticates the request. It validates the token: signed by Entra, not expired, issued for Azure Resource Manager as its audience. If not, the request stops with 401 Unauthorized.
4. ARM authorizes the request. It checks Azure RBAC: does this identity hold a role, at this scope or any scope above it, that allows the action Microsoft.Storage/storageAccounts/write? If not, 403 Forbidden.
5. ARM checks policy. Azure Policy rules attached at any level above are evaluated against the request body. A rule such as "storage accounts must not allow public access" or "only EU regions" can deny the request here, before anything is created.
6. ARM checks locks. If the resource or any scope above it has a lock that forbids this operation, the request is rejected.
7. ARM forwards the request to the resource provider. The URL path names the provider (providers/Microsoft.Storage/storageAccounts), so ARM routes the request to the Storage resource provider, which actually knows how to create a storage account.
8. The resource provider does the work. It validates the configuration, reserves the name, allocates capacity in the region, and starts creating the account.
9. The response comes back. For quick operations the provider answers immediately with the resource's state. For slow ones, which is most creations, it answers with 202 Accepted or 201 Created and a URL where the caller can check on progress; this is called a long-running operation. The CLI quietly polls that URL until the operation finishes, which is why az commands sometimes sit at "Running..." for a minute.
10. ARM logs the operation in the subscription's activity log: who did what, to which resource, when, and whether it succeeded.
Every management action in Azure is this sequence. A portal click, a template deployment and a Terraform run all go through the same authenticate, authorize, policy, lock, route steps. When a deployment fails with a 401, 403, a policy violation or a lock error, you now know which step said no.
Every ARM request carries an api-version query parameter, a date such as 2023-05-01. Each resource provider publishes its API in dated versions, and a request is handled according to the version it asks for.
This lets Azure add new properties and change behaviour without breaking old scripts: a template written against an old storage API version keeps working years later, because ARM still understands that version. When you see @2023-05-01 in a Bicep file or api-version= in a URL, that is all it means: "interpret this request the way version 2023-05-01 of this API defines it".
Part 2 introduced resource providers (Microsoft.Storage, Microsoft.Web and so on) as the services that supply each type of resource. Two more facts about them become relevant now.
First, a subscription must be registered with a resource provider before it can create that provider's resources. Common providers are registered automatically, and many tools register a provider for you the first time you use it. But a "subscription is not registered to use namespace" error is a classic first-day surprise, and the fix is one command:
az provider register --namespace Microsoft.Web
az provider show --namespace Microsoft.Web --query registrationStateSecond, providers can be explored. Each one lists its resource types, the regions they are available in and their API versions. This is the source of truth for questions such as "can I create this type of resource in this region?":
# Which resource types does the Storage provider offer, and where?
az provider show --namespace Microsoft.Storage \
--query "resourceTypes[?resourceType=='storageAccounts'].locations" --output jsonHere is the distinction that resolves more Azure confusion than any other in this part. Azure handles two completely different kinds of request:
| Control plane | Data plane | |
|---|---|---|
| What it does | manages resources: create, configure, delete | uses resources: read and write what is inside them |
| Example | create a storage account; change its redundancy | upload a blob; read a queue message; run a SQL query |
| Address | management.azure.com (Resource Manager) | the resource's own endpoint, such as stphotodropdev01.blob.core.windows.net |
| Who handles it | ARM, then the resource provider | the service itself, directly |
| Permissions | management roles (Owner, Contributor, Reader) | data roles (Storage Blob Data Reader, and so on) or service-specific keys |
| Logged in | the activity log | the service's own logs, if enabled |
| Affected by locks | yes | no |
Your application, at run time, almost never touches the control plane. When PhotoDrop uploads a photo, it talks directly to the storage account's blob endpoint, not to Resource Manager. Resource Manager is for setting things up; the data plane is for running.
The distinction explains several things that otherwise look like bugs:
CanNotDelete lock stops someone deleting the storage account; it does not stop an app deleting blobs inside it.Look again at the request from earlier. It is a PUT with the complete desired configuration of the resource: "there should be a storage account at this address, in West Europe, with LRS redundancy." It does not say "create" or "change"; it says "make it so".
That makes the request idempotent: sending it once or ten times leaves the same result.
This is a small HTTP detail with a large consequence. Because every resource can be described as a desired end state, and sending that description is safe to repeat, a whole environment can be written down as a file and applied again and again. That is the foundation of Infrastructure as Code.
There are two styles of telling Azure what you want:
| Imperative | Declarative | |
|---|---|---|
| You write | the steps: create this, then that, then change this | the end state: these resources should exist, configured like this |
| Typical tools | portal clicks, CLI scripts | Bicep, ARM templates, Terraform |
| Running it twice | may fail ("already exists") or duplicate work, unless the script checks first | safe: the second run finds nothing to change |
| Seeing what will change | hard | built in: tools can show a preview before applying |
| Reproducing an environment | re-run a script and hope | apply the same file to a new resource group |
Imperative commands are perfect for learning and for one-off tasks, and this path uses the CLI heavily for exactly that reason. For anything that must be reproduced (a staging environment that matches production, a dev environment for each developer), the declarative style wins.
Bicep is Microsoft's language for declaring Azure resources. Its files compile to ARM templates (the older JSON format) and are sent to ARM as a deployment. The PhotoDrop storage account in Bicep:
param location string = resourceGroup().location
resource storage 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: 'stphotodropdev01'
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
minimumTlsVersion: 'TLS1_2'
allowBlobPublicAccess: false
}
}Every piece maps onto something from this part or Part 2: the resource type (Microsoft.Storage/storageAccounts), the API version (@2023-05-01), and the same properties the CLI put in its JSON body. Deploying it:
# Preview what would change, without changing anything
az deployment group what-if --resource-group rg-photodrop-dev --template-file main.bicep
# Apply it (safe to run again: the second run changes nothing)
az deployment group create --resource-group rg-photodrop-dev --template-file main.bicepEach template deployment is recorded in the resource group's deployment history, so you can see what was deployed, when, and with which parameters. Infrastructure as Code gets its own track later in this notebook; for now the point is only that it is possible because ARM accepts idempotent, declarative PUTs.
Since every tool is just an HTTP client, you can skip the tools and call ARM yourself. The CLI's az rest command sends a raw request with your login token already attached, which makes the "it's all just HTTP" idea concrete:
# List resource groups by calling Resource Manager directly.
# az rest fills in {subscriptionId} from your active subscription.
az rest --method get \
--url "https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups?api-version=2021-04-01"The JSON that comes back is exactly what az group list formats into a table. Seeing the raw response once is worth it; after that, the higher-level commands are simply more convenient.
ARM also protects itself. Each subscription and each identity can only send so many requests in a period, and a script that hammers the API gets 429 Too Many Requests responses with a header saying how long to wait. Well-behaved tools, including the CLI and SDKs, back off and retry automatically.
Every control-plane write that ARM handles lands in the subscription's activity log, kept for 90 days by default. It answers the questions people ask after something has gone wrong: who deleted that resource group, who changed that setting, did that deployment really run?
# Recent management operations in a resource group
az monitor activity-log list --resource-group rg-photodrop-dev \
--offset 7d --output tableBecause every tool goes through ARM, the activity log is complete: there is no way to make a management change that does not show up here. (Data-plane operations, as covered above, are not in it.)
Every way of managing Azure, from the portal to Terraform, is an HTTP client for one service, Azure Resource Manager. ARM authenticates the caller, checks RBAC, policy and locks, then routes the request to the resource provider that does the work, and logs it. That is the control plane: managing resources. Using them (uploading a blob, querying a database) is the data plane, which goes straight to the resource's own endpoint with its own permissions. And because a resource is created by an idempotent PUT of its desired state, whole environments can be described in files and applied repeatedly: Infrastructure as Code.
Four parts of concepts are enough. Part 5 sets up a real working environment: a free Azure account with a budget so it can never surprise you, the Azure CLI and az login, and the local emulators (Azurite, Functions Core Tools, Docker) that let most of this path run on a laptop without touching the cloud at all. It ends with a smoke test of every tool.