Skip to main content

Challenge 01: Patient Data Never Leaves the VNet

Scenario Brief

Industry: Healthcare | Regulatory Context: HIPAA, EU AI Act Article 10(5)
Time Estimate: 90 minutes | Azure Cost: ~$8–12


What's at Stake​

Your client is Northside Regional Medical Center, a 450-bed hospital in Germany that processes 8,000 patient records per day. Their legal team issued a hard requirement:

"No patient data β€” including metadata, conversation history, or embeddings β€” may traverse the public internet or reside on infrastructure not under our control."

Their current AI chatbot sends summaries to a US-based cloud API. After a GDPR investigation, their DPO has given you 3 weeks to replace it with a compliant solution.


Skills Practiced​

  • Deploying Azure AI Foundry in Standard mode with BYO storage
  • Configuring Private Endpoints for the Foundry account
  • Setting up BYO VNet for Hosted Agent isolation
  • Disabling public network access on all AI resources
  • Verifying data residency with Azure Policy

Architecture Decision​

Why Hosted Agents + Standard Mode?

OptionWhy Not
Prompt Agent (Basic mode)Microsoft manages storage β€” violates BYO requirement
Workflow AgentPreview; limited VNet support as of mid-2025
External AKS orchestrationHigher ops burden; loses Entra Agent ID benefits
Hosted Agent (Standard mode)βœ… BYO VNet + storage + Micro-VM isolation + Entra Agent ID

🧰 Before You Start β€” Environment Setup​

This challenge is a data-residency / network-isolation build. Your setup is mostly Azure access and networking β€” the win is proving no data leaves your boundary.

Prerequisites​

RequirementWhy you need itHow to check
Azure subscription with Contributor on a resource groupCreate Foundry, VNet, private endpointsaz account show
Azure CLI (or Azure PowerShell)Provision + verify network isolationaz version
Rights to create a VNet + Private Endpoints + Private DNSThe whole point β€” keep traffic off the public internetNetwork Contributor role
A region matching your residency rule (e.g. germanywestcentral)Data must physically reside in-boundaryaz account list-locations -o table

Step 0 β€” Sign in and set your context (5 min)​

Where you run this: in a terminal with the Azure CLI signed in β€” unlike the local-only Python challenges, these az commands run against real resources in your Azure subscription.

az login
az account set --subscription "<your-subscription-id>"
az group create --name rg-foundry-private --location germanywestcentral

βœ… Done when az account show returns the right subscription and az group show -n rg-foundry-private exists in your residency region.

Step 1 β€” Confirm the requirement, then create the Standard-mode project (10 min) β€” the "where do I go"​

First, write down the exact rule you must satisfy (region, no public egress, BYO storage) β€” everything you build is verified against this one sentence in Success Criteria.

Then create the project that makes isolation possible. Data-residency + BYO networking require Standard mode (a hub-based Foundry project), not the default free project:

  1. Go to ai.azure.com β†’ + Create project β†’ Advanced options.
  2. Set Region to your residency region (e.g. germanywestcentral), and choose Create new hub so you can attach your own storage/Key Vault later.
  3. After it provisions, open Management center β†’ your project β†’ Overview and note the hub it's attached to β€” Tasks 1–3 configure private endpoints on that hub's resources.

βœ… Done when you have a hub-based project in the correct region (its resource group shows a Storage account + Key Vault you can bring under a private endpoint).

🟦 Microsoft-first note: this challenge is already 100% Azure-native β€” Azure AI Foundry Standard mode, Private Endpoints, BYO VNet + Storage + Key Vault, Private DNS zones, and Azure Policy for enforcement. There is no third-party component to add; the skill is wiring them correctly.

Common fixes: no BYO storage/networking options β†’ you created a default project, not a hub-based Standard one; recreate via Advanced options. Region locked β†’ check your subscription's allowed regions with az account list-locations -o table.

The path through this challenge​

  1. Task 1 β€” deploy Foundry in Standard mode with BYO storage.
  2. Task 2 β€” add private endpoints + private DNS.
  3. Task 3 β€” disable public network access everywhere.
  4. Task 4 β€” verify residency with Azure Policy + a DNS test.
  5. Success Criteria β€” prove traffic resolves to a 10.x VNet IP.
  6. Adapt to Your Business β€” apply the boundary to your data rule.

⏱️ Time budget: ~90 minutes. The DNS/private-endpoint verification (Task 4) is where you actually prove isolation β€” don't skip it.


Your Tasks​

Task 1: Deploy Foundry Account in Standard Mode​

# Deploy in Germany West Central for EU data residency
az group create --name rg-northside-ai --location germanywestcentral

az ai foundry account create \
--name northside-foundry \
--resource-group rg-northside-ai \
--location germanywestcentral \
--sku Standard \
--public-network-access Disabled
Standard Mode Is Not the Default

The portal defaults to Basic mode. Always specify --sku Standard for enterprise customers. In Basic mode, Microsoft manages conversation artifacts β€” the DPO will reject this.

Task 2: Create Private Endpoint + DNS​

# Disable public access
az ai foundry account update \
--name northside-foundry \
--resource-group rg-northside-ai \
--public-network-access Disabled

# Create private endpoint (assumes VNet + subnet already exist)
az network private-endpoint create \
--name pe-northside-foundry \
--resource-group rg-northside-ai \
--vnet-name vnet-northside \
--subnet snet-ai \
--private-connection-resource-id $(az ai foundry account show \
--name northside-foundry \
--resource-group rg-northside-ai --query id -o tsv) \
--group-id account \
--connection-name northside-foundry-conn

# Create private DNS zone
az network private-dns zone create \
--resource-group rg-northside-ai \
--name "privatelink.services.ai.azure.com"

az network private-dns link vnet create \
--resource-group rg-northside-ai \
--zone-name "privatelink.services.ai.azure.com" \
--name foundry-dns-link \
--virtual-network vnet-northside \
--registration-enabled false

Task 3: Connect BYO Storage and Key Vault​

az storage account create \
--name stnorthsideai \
--resource-group rg-northside-ai \
--location germanywestcentral \
--sku Standard_LRS \
--kind StorageV2 \
--enable-hierarchical-namespace true \
--public-network-access Disabled

az keyvault create \
--name kv-northside-ai \
--resource-group rg-northside-ai \
--location germanywestcentral \
--public-network-access Disabled

Task 4: Deploy Hosted Agent​

import os
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential

client = AIProjectClient(
endpoint=os.environ["PROJECT_ENDPOINT"],
credential=DefaultAzureCredential()
)

agent = client.agents.create_agent(
model="gpt-4o",
name="northside-clinical-assistant",
instructions="""You are a clinical documentation assistant.
Summarize physician notes and surface relevant ICD-10 codes.
Never include patient names, dates of birth, or MRN numbers.""",
)

print(f"Agent created: {agent.id}")
print(f"Entra Agent ID: {agent.identity}") # Each agent gets its own managed identity

Task 5: Verify Compliance with Azure Policy​

az policy assignment create \
--name "ai-private-link-required" \
--scope /subscriptions/<sub-id>/resourceGroups/rg-northside-ai \
--policy "Cognitive Services accounts should use private link" \
--enforcement-mode Default

Success Criteria​

  • Foundry account deployed in germanywestcentral with Standard mode
  • Public network access disabled on Foundry, Storage, and Key Vault
  • Private endpoint created and privatelink.services.ai.azure.com DNS zone linked to VNet
  • Agent deployed and returns responses only via private endpoint
  • Resolve-DnsName northside-foundry.services.ai.azure.com returns a 10.x.x.x IP from VNet VM
  • Azure Policy shows compliant

πŸ” Adapt This to Your Own Business​

The scenario is a German hospital under GDPR, but many organizations have a hard "data must not leave X" boundary. The pattern β€” private networking + BYO storage + policy enforcement β€” is identical whether the driver is HIPAA, GDPR, or a sovereign-cloud mandate.

Step 1 β€” Find your data-residency boundary​

IndustryThe hard requirementThe driver
HealthcarePHI never leaves the region / VNetHIPAA, GDPR
Financial servicesCustomer data in-country onlyData sovereignty laws
Government / defenseData in a sovereign or Gov cloudFedRAMP / national rules
LegalPrivileged data never on shared infraAttorney-client privilege
Any EU entityNo transfer outside the EEAGDPR Chapter V

Step 2 β€” Map the building blocks to your stack (Microsoft-first)​

In this challengeIn your project β€” use
Foundry Standard mode + BYO storageSame β€” Azure AI Foundry Standard mode with your storage account
Private Endpoints + Private DNSSame β€” extend to every dependency (SQL, Search, Key Vault)
Disable public network accessApply to all data services, not just Foundry
Azure Policy complianceAzure Policy initiative + Purview for data governance
Region pinningDeploy to your required region; consider sovereign cloud

Step 3 β€” The 5-question implementation checklist​

  1. What is the exact boundary? Write it as one sentence before you build.
  2. Does every dependency have a private endpoint? One public egress point breaks the whole guarantee.
  3. Is public network access disabled everywhere? Default-deny, then allow the VNet.
  4. Can you prove traffic stays private? A DNS resolution to a 10.x IP is your evidence.
  5. Is compliance enforced, not just configured? Azure Policy stops drift.

Step 4 β€” A 1-week rollout plan​

DayActionOwner
Day 1Document the residency rule; pick the regionCompliance + cloud
Day 2Deploy Foundry Standard mode + BYO storage in-regionCloud eng
Day 3Add private endpoints + private DNS for every dependencyNetwork eng
Day 4Disable public access; run the DNS/private-link testNetwork eng
Day 5Apply an Azure Policy initiative; confirm compliantGovernance

Step 5 β€” Prove the ROI​

  • Private-link coverage β€” % of data services with public access disabled (target: 100%).
  • Egress proof β€” DNS resolves to a private 10.x IP (target: yes, on every endpoint).
  • Policy compliance β€” % of resources compliant with the residency initiative (target: 100%).

πŸ’‘ Rule of thumb: "we configured it privately" is not the same as "we proved nothing leaks." Resolve the DNS, check the IP, and let Azure Policy keep it that way.

Doing this solo (no team, portfolio-first)​

No team, no budget? Data-residency architecture is a rare, well-paid skill β€” you can prove it with one small deployment. Run the week solo:

  • Mon–Tue β€” deploy Foundry Standard mode + one storage account in your required region.
  • Wed–Thu β€” add a private endpoint + private DNS to one dependency and disable public network access.
  • Fri β€” capture the proof: nslookup resolving to a 10.x private IP + an Azure Policy compliance screenshot. Then tear it down (see Cleanup).

πŸ“¦ Ship this artifact: an architecture diagram (draw.io / Mermaid) + the DNS-to-private-IP screenshot + a one-page "residency guarantee" write-up. Resume bullet: "Designed a data-residency-compliant AI platform β€” 100% private-link coverage with DNS-verified private egress and Azure Policy enforcement."

πŸ†“ Free-tier path: an Azure free account (starter credit) covers one VNet + private endpoint for the exercise; delete the resource group the same day to stay at $0.


πŸ“‹ Regulatory mapping β€” GDPR Β· EU AI Act Β· HIPAA
RequirementRegulationEnforcement
Data residency (Germany)GDPR Art. 44, EU AI Act Art. 10(5)Resource location = germanywestcentral
No public internet transitGDPR Art. 32Private endpoints + disabled public access
Customer-managed keysHIPAA Β§ 164.312(a)Key Vault CMK for storage encryption
AuditabilityEU AI Act Art. 12Azure Monitor + Activity Log

πŸ’‘ Hints (try to solve first)
  1. Private DNS Zone: Without privatelink.services.ai.azure.com linked to the VNet, the private endpoint resolves to a public IP β€” defeating the purpose.
  2. Storage needs TWO private endpoints: one for blob, one for dfs sub-resources.
  3. Key Vault access: Grant the Foundry account's managed identity Key Vault Crypto User role.
  4. Region discipline: Deploy ALL resources in germanywestcentral β€” even a Log Analytics workspace in eastus can trigger a data residency review.

Break & Fix​

Your colleague deployed everything. The portal shows "Approved" on the private endpoint. But the agent times out from the hospital VNet.

Investigate:

  1. Resolve-DnsName northside-foundry.services.ai.azure.com β€” does it return a 10.x.x.x or public IP?
  2. Check NSG rules β€” is TCP 443 allowed inbound on snet-ai?
  3. Is the Private DNS Zone actually linked to vnet-northside?

Knowledge Check​

  1. What is the difference between Basic mode and Standard mode, and why does Basic mode violate data residency requirements?
  2. When you disable public network access on a Foundry account, what else must you configure for clients inside the VNet to reach it?
  3. Why does each Hosted Agent get its own Entra Agent ID rather than sharing a service principal?
  4. Which Azure Policy built-in enforces private link for AI services?

Cleanup​

az group delete --name rg-northside-ai --yes --no-wait