Skip to content

Instantly share code, notes, and snippets.

@lassebenni
Created August 2, 2026 20:27
Show Gist options
  • Select an option

  • Save lassebenni/00775afb167c4c55ace0f41048f849d3 to your computer and use it in GitHub Desktop.

Select an option

Save lassebenni/00775afb167c4c55ace0f41048f849d3 to your computer and use it in GitHub Desktop.
Visual for: Every command needs a scope (Week 14 Azure hierarchy)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Visual: Every command needs a scope</title>
<style>
body {
margin: 0;
padding: 24px;
background: #faf5d9;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
}
svg { max-width: 760px; width: 100%; height: auto; }
</style>
</head>
<body>
<svg viewBox="0 0 760 596" xmlns="http://www.w3.org/2000/svg" font-family="Lato, Helvetica Neue, Arial, sans-serif">
<rect x="2" y="2" width="756" height="592" rx="16" fill="#ffffff" stroke="#e6dfb8" stroke-width="2"/>
<text x="380" y="38" text-anchor="middle" fill="#b12900" font-size="22" font-weight="700">Every command needs a scope</text>
<text x="380" y="61" text-anchor="middle" fill="#595959" font-size="14">Azure has no default location. Each level of the hierarchy is something you point at, by name.</text>
<!-- TENANT -->
<rect x="30" y="80" width="700" height="330" rx="12" fill="#f7f7f7" stroke="#8a8a8a" stroke-width="2"/>
<text x="46" y="103" fill="#595959" font-size="12" font-weight="700">TENANT</text>
<text x="106" y="103" fill="#000000" font-size="12">HackYourFuture, the organization</text>
<text x="714" y="103" text-anchor="end" fill="#8a8a8a" font-size="11" font-family="SF Mono, Menlo, monospace">az login --tenant 07a1…</text>
<!-- SUBSCRIPTION -->
<rect x="52" y="116" width="656" height="278" rx="12" fill="#e3f2fd" stroke="#1565c0" stroke-width="2"/>
<text x="68" y="139" fill="#1565c0" font-size="12" font-weight="700">SUBSCRIPTION</text>
<text x="164" y="139" fill="#000000" font-size="12">what gets billed, and who may act</text>
<text x="692" y="139" text-anchor="end" fill="#1565c0" font-size="11" font-family="SF Mono, Menlo, monospace">az account show</text>
<!-- RESOURCE GROUP -->
<rect x="74" y="152" width="612" height="226" rx="12" fill="#f3edc6" stroke="#b12900" stroke-width="3"/>
<text x="90" y="175" fill="#b12900" font-size="12" font-weight="700">RESOURCE GROUP</text>
<text x="228" y="175" fill="#000000" font-size="12">rg-hyf-students, created by your teacher</text>
<text x="670" y="175" text-anchor="end" fill="#b12900" font-size="11" font-family="SF Mono, Menlo, monospace">--resource-group rg-hyf-students</text>
<text x="670" y="192" text-anchor="end" fill="#b12900" font-size="11" font-family="SF Mono, Menlo, monospace">targetScope = 'resourceGroup'</text>
<!-- RESOURCE -->
<rect x="96" y="206" width="568" height="152" rx="10" fill="#e8f5e9" stroke="#2e7d32" stroke-width="2"/>
<text x="112" y="229" fill="#2e7d32" font-size="12" font-weight="700">RESOURCE</text>
<text x="188" y="229" fill="#000000" font-size="12">your storage account</text>
<text x="648" y="229" text-anchor="end" fill="#2e7d32" font-size="11" font-family="SF Mono, Menlo, monospace">resource storage '…' = { }</text>
<!-- NESTED CHILD -->
<rect x="118" y="258" width="524" height="82" rx="10" fill="#ede7f6" stroke="#5e35b1" stroke-width="2"/>
<text x="134" y="281" fill="#5e35b1" font-size="12" font-weight="700">NESTED CHILD</text>
<text x="230" y="281" fill="#000000" font-size="12">the blob container inside it</text>
<text x="626" y="281" text-anchor="end" fill="#5e35b1" font-size="11" font-family="SF Mono, Menlo, monospace">parent: storage</text>
<text x="134" y="311" fill="#595959" font-size="11.5">Each level is named relative to the one above it. Nothing is implicit.</text>
<!-- deploy arrow annotation -->
<text x="380" y="432" text-anchor="middle" fill="#b12900" font-size="12.5" font-weight="700">Your deploy is anchored at the red level: the group exists already, everything inside it is yours to declare.</text>
<!-- error band -->
<rect x="30" y="450" width="700" height="122" rx="10" fill="#fdecea" stroke="#b12900" stroke-width="2"/>
<text x="46" y="473" fill="#b12900" font-size="13" font-weight="700">Three errors this explains, before you blame the template</text>
<text x="46" y="496" fill="#000000" font-size="12"><tspan font-family="SF Mono, Menlo, monospace" font-size="11">SubscriptionNotFound</tspan> · you are signed in at tenant level with no subscription picked</text>
<text x="46" y="517" fill="#000000" font-size="12"><tspan font-family="SF Mono, Menlo, monospace" font-size="11">AuthorizationFailed</tspan> · right subscription, but your role does not reach that scope</text>
<text x="46" y="538" fill="#000000" font-size="12">• cannot create the resource group · your role starts one level down, inside it</text>
<text x="380" y="559" text-anchor="middle" fill="#595959" font-size="11">Diagnose the first two with <tspan font-family="SF Mono, Menlo, monospace" font-size="10.5">az account show</tspan>. If <tspan font-family="SF Mono, Menlo, monospace" font-size="10.5">id</tspan> equals <tspan font-family="SF Mono, Menlo, monospace" font-size="10.5">tenantId</tspan>, no subscription is selected.</text>
</svg>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment