# Azure infrastructure lab

Original LockedIn Labs exercise · reviewed 20 October 2026.
Companion: /training/vendors#azure.

## Understand model requests before connecting AI

Use the [free model request workbook](/templates/cloud-model-request-workbook.md)
to separate the SDK, service endpoint, model and agent loop. Compare this
provider's normal text, output-limit and custom function responses. Then open
the [runnable response lab](/training/guides/cloud-responses): predict a decision,
run the standard-library Python adapter and change one synthetic response. No
cloud account or model key is needed; no function proposal is executed.

## What you will understand

An Entra tenant is an identity directory. A subscription is a management and
billing boundary. A resource group organizes lifecycle, while a VNet and subnet
define networking. You will create a private Linux VM and inspect its interface
and disk before removing this lab's dedicated resource group.

## Read a private request before changing access

This no-account exercise comes before provisioning. A private IP is an address,
not a guarantee of reachability or permission. DNS finds an address; routes and
traffic rules let a connection reach a listener; TLS verifies the server and
protects the connection; the application authorizes the requested data.

Draw a document assistant at `10.24.1.10` calling a records service at
`10.24.2.15:443` inside a Azure Virtual Network. These are fictional addresses.
The name `records.example.test` is for illustration only. Do not send requests
to these addresses. A port identifies the service endpoint on a host; this
example uses TCP port 443 for HTTPS.

Label the name lookup **Azure Private DNS zone** and the traffic check
**effective network security group rules**. A DNS lookup does not carry the API request.
Account for forward and return routes, other applicable traffic controls and
the running server's listener. Application identity and data policy are separate.

For each case, write (1) what is observed, (2) what cannot yet be concluded,
and (3) the next observation or bounded action:

| Case | Supplied evidence | Your next step |
| --- | --- | --- |
| Only a timeout | DNS returns the intended address; a new TCP connection times out; no other path evidence | Explain why the firewall is not yet a proven cause. |
| A different address | DNS returns `10.24.2.99`; the deployment record expects `.15`; no connection attempted | Inspect the caller's DNS view before changing traffic or TLS settings. |
| A policy finding | An authorized investigation additionally establishes that this specific new connection is not allowed by the effective traffic policy | If the path is approved, scope a proposed change to the caller, destination and port, then retest. |
| The service says no | Connection and TLS succeed; the intended service's correlated log denies another customer's document; HTTP 403 | Preserve the denial and test an approved document with the same workload identity. |
| One approved read | The service identifies the caller, allows its document and returns the expected ID and revision; HTTP 200 | Record this success alongside the forbidden-read evidence. |

Review: a timeout alone does not distinguish routing, traffic policy, an
unavailable host or another connection failure. A private address may be the
wrong destination. Saving a rule does not prove a working request. A 403 alone
could originate at an intermediary; in this case the service's correlated log
identifies the denying layer. One permitted request does not establish readiness
for all callers, failures or loads. Never turn an unobserved layer into a pass.

The protected regions-and-networks lesson provides the visual version and
case-specific feedback. For a local runnable exercise with real sockets and
TLS, use the [free networking lab](https://training.lockedinlabs.ai/training/guides/networking).
This teaching case is separate from the isolated VM below: that VM deliberately
has no exposed application or inbound access. Do not open it merely to reproduce
the diagram.

## Before creating anything

Use an approved training subscription and current Azure CLI. Authenticate through
the organization's normal flow. Confirm the tenant/subscription, resource policy,
available VM size, regional capacity, quota and current prices. Agree a budget and
cleanup time. These steps create real resources and can incur charges.

Use only a new dedicated lab resource group. Read each block before running it;
stop and inspect partial resources on error. Do not apply this cleanup procedure
to a shared group. Keep keys, tokens and private customer data out of evidence.

```bash
LAB_SUBSCRIPTION="replace-with-approved-subscription-id"
LAB_REGION="eastus"
LAB_NAME="fde-lab-$(date +%Y%m%d%H%M%S)"
LAB_GROUP="$LAB_NAME-rg"
LAB_PUBLIC_KEY="$HOME/.ssh/id_ed25519.pub"
az account show --subscription "$LAB_SUBSCRIPTION" \
  --query '{subscription:id,tenant:tenantId,name:name}'
az vm list-skus --subscription "$LAB_SUBSCRIPTION" --location "$LAB_REGION" \
  --size Standard_B1s --all --output table
az group exists --name "$LAB_GROUP" --subscription "$LAB_SUBSCRIPTION"
test -f "$LAB_PUBLIC_KEY"
```

The group existence result must be `false`. The public key must exist; if it
does not, use your organization's approved SSH-key setup. Do not substitute a
private key file. The key is used to configure the guest account; this lab opens
no SSH path. The example region and size are not universal availability promises.
Check SKU restrictions and choose an approved available size before proceeding.

## Create the group and network

```bash
az group create --name "$LAB_GROUP" --location "$LAB_REGION" \
  --subscription "$LAB_SUBSCRIPTION" --tags purpose=fde-training
az network vnet create --name "$LAB_NAME-vnet" --resource-group "$LAB_GROUP" \
  --location "$LAB_REGION" --address-prefixes 10.28.0.0/16 \
  --subnet-name lab --subnet-prefixes 10.28.1.0/24 --subscription "$LAB_SUBSCRIPTION"
az network nsg create --name "$LAB_NAME-nsg" --resource-group "$LAB_GROUP" \
  --location "$LAB_REGION" --subscription "$LAB_SUBSCRIPTION"
az network nsg rule create --nsg-name "$LAB_NAME-nsg" --name deny-lab-inbound \
  --resource-group "$LAB_GROUP" --priority 1000 --direction Inbound \
  --access Deny --protocol '*' --source-address-prefixes '*' \
  --source-port-ranges '*' --destination-address-prefixes '*' \
  --destination-port-ranges '*' --subscription "$LAB_SUBSCRIPTION"
```

The explicit deny rule overrides the default inbound VNet allowances for this
inspection exercise. No public IP, Bastion, NAT or application endpoint is created.
The subnet is regional; it is not bound to one Availability Zone.

## Create one VM

```bash
az vm create --name "$LAB_NAME" --resource-group "$LAB_GROUP" \
  --location "$LAB_REGION" --subscription "$LAB_SUBSCRIPTION" \
  --image Ubuntu2404 --size Standard_B1s --admin-username labuser \
  --authentication-type ssh --ssh-key-values "$LAB_PUBLIC_KEY" \
  --vnet-name "$LAB_NAME-vnet" --subnet lab --nsg "$LAB_NAME-nsg" \
  --nsg-rule NONE --public-ip-address "" \
  --storage-sku Standard_LRS --os-disk-size-gb 30
```

The image alias resolves to an image version at creation time; record the actual
version. This is a CPU VM with no model workload. No managed identity is granted
application permissions. Guest package downloads and remote management would
require a separately designed authorized path.

## Inspect every resource

```bash
az vm show --name "$LAB_NAME" --resource-group "$LAB_GROUP" \
  --subscription "$LAB_SUBSCRIPTION" --show-details \
  --query '{name:name,powerState:powerState,publicIps:publicIps,privateIps:privateIps,hardware:hardwareProfile,storage:storageProfile,network:networkProfile}'
az resource list --resource-group "$LAB_GROUP" --subscription "$LAB_SUBSCRIPTION" \
  --query '[].{name:name,type:type,location:location}' --output table
az network nsg rule list --nsg-name "$LAB_NAME-nsg" --resource-group "$LAB_GROUP" \
  --subscription "$LAB_SUBSCRIPTION" --output table
```

Verify the intended VM, disk and interface, no public IP, and the explicit deny
rule. Explain why VM power state does not establish application readiness.
Draw the relationship between tenant, subscription, group, VNet, subnet, NIC,
VM and disk. Mark which are identity, lifecycle, location and network concepts.

## Cleanup

List the group again and confirm that **every resource belongs only to this lab**.
If someone added shared resources, stop and obtain a scoped cleanup plan.

```bash
az resource list --resource-group "$LAB_GROUP" --subscription "$LAB_SUBSCRIPTION" \
  --output table
az group delete --name "$LAB_GROUP" --subscription "$LAB_SUBSCRIPTION"
az group exists --name "$LAB_GROUP" --subscription "$LAB_SUBSCRIPTION"
```

Accept the CLI's deletion confirmation only for your verified dedicated lab
group. Do not add `--no-wait`; wait for completion. The final existence result
should be `false`. Verify the inventory and later cost report. Stopping a VM
alone does not remove persistent disks and other charges.

## Add the AI design

Without creating additional resources, draw a managed identity, authorized Blob
source, search index and Microsoft Foundry model deployment.

1. Name the deployment, model/API, identity and processing location.
2. Separate gateway policy, cloud RBAC and application tenant authorization.
3. Specify normal, denied-source and unavailable-model responses.
4. Explain how a corrected document reaches the index and how a citation is checked.
5. Use the official Microsoft lab environment for actual model invocation and
   retain that evidence separately.

## Follow the cost after an alert — no cloud account required

A budget is a plan for a scope and time period. A notification tells someone
that a threshold was reached or forecast. Enforcement is a separate control
that refuses work or changes a resource. A quota can limit requests or resources
without limiting the currency cost of the whole application.

Draw three cost streams for the fictional Field Desk: model usage, running
compute and retained data. Use these **invented teaching rates, not vendor
prices**: $14/hour for model usage, $4/hour for compute and $2/hour for retained
resources. Start with $80 already accrued and a $100 notification threshold.

1. At the end of hour 1, the total reaches $100. Assume notification and response
   occur two hours later, at the end of hour 3. This is a teaching delay, not a
   claim about the provider's reporting schedule.
2. Predict the total at the end of hour 6 for each response: notify only; stop
   new model work; stop new model work and release compute. Keep the data in
   every case. A response affects subsequent hours, not costs already accrued.
3. Draw each accumulated-cost line. Label the threshold, response time and each
   cost stream that remains. Explain why none of the lines stops at $100.
4. Repeat with an immediate response at the end of hour 1. What changes? What
   still costs money?
5. Write the scope, owner, action, required permission, remaining billable
   resources and safe restart rule for a real training environment. Keep this
   proposed design separate from an observed cloud result.

Review after making your prediction:

| Response | Hour 6 total: two-hour delay | Hour 6 total: immediate response |
| --- | ---: | ---: |
| Notify only | $200 | $200 |
| Stop new model work | $158 | $130 |
| Stop new model work and release compute | $146 | $110 |

For example, with the delayed compute response: $80 + (3 × $20) + (3 × $2)
= $146. Storage remains. This simplified exercise excludes in-flight requests,
commitments, taxes and other services; a real inventory must account for them.
Model token limits and bounded retries help control request costs, but do not
cap the entire cloud bill. Do not run a shutdown or delete data just to reproduce
this paper exercise.

Microsoft Cost Management budget alerts do not stop consumption. Releasing
VM compute here means deallocation, not merely shutting down its operating
system. Managed disks and other retained resources can remain billable. Check
the actual power state and complete inventory before claiming cleanup.

- [Microsoft Cost Management budgets](https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-acm-create-budgets)
- [Azure VM states and billing](https://learn.microsoft.com/en-us/azure/virtual-machines/states-billing)

Provider references checked 21 October 2026.

## Certification preparation

Our course connects selected infrastructure and AI delivery responsibilities.
Complete the wider official labs before assessing exam readiness:

- [AZ-104 course](https://learn.microsoft.com/en-us/training/courses/az-104t00)
- [AZ-104 study guide](https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104)
- [AI-103 course](https://learn.microsoft.com/en-us/training/courses/ai-103t00)
- [AI-103 study guide](https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/ai-103)
- [Azure VM command reference](https://learn.microsoft.com/en-us/cli/azure/vm)

AI-102 retired on 30 June 2026. AI-103 adds a current study destination; it does
not make our introductory route complete coverage of vision, language,
information extraction or every implementation objective.

The Training site has not provisioned resources for you. Your own sandbox run
is required to establish live evidence. Microsoft awards its certifications.
