Azure Defaults Skill
Single source of truth for all Azure infrastructure configuration used across agents.
Replaces individual _shared/ file lookups with one consolidated reference.
Quick Reference (Load First)
Default Regions
| Service |
Default Region |
Reason |
| All resources |
swedencentral |
EU GDPR-compliant |
| Static Web Apps |
westeurope |
Not available in swedencentral |
| Azure OpenAI |
swedencentral |
Limited availability — verify first |
| Failover |
germanywestcentral |
EU paired alternative |
Required Tags (Azure Policy Enforced)
| Tag |
Required |
Example Values |
Environment |
Yes |
dev, staging, prod |
ManagedBy |
Yes |
Bicep |
Project |
Yes |
Project identifier |
Owner |
Yes |
Team or individual name |
Bicep pattern:
tags: {
Environment: environment
ManagedBy: 'Bicep'
Project: projectName
Owner: owner
}
Unique Suffix Pattern
Generate ONCE in main.bicep, pass to ALL modules:
// main.bicep
var uniqueSuffix = uniqueString(resourceGroup().id)
module keyVault 'modules/key-vault.bicep' = {
params: { uniqueSuffix: uniqueSuffix }
}
Security Baseline
| Setting |
Value |
Applies To |
supportsHttpsTrafficOnly |
true |
Storage accounts |
minimumTlsVersion |
'TLS1_2' |
All services |
allowBlobPublicAccess |
false |
Storage accounts |
publicNetworkAccess |
'Disabled' (prod) |
Data services |
| Authentication |
Managed Identity |
Prefer over keys/strings |
| SQL Auth |
Azure AD-only |
azureADOnlyAuthentication: true |
CAF Naming Conventions
Standard Abbreviations
| Resource |
Abbreviation |
Name Pattern |
Max Length |
| Resource Group |
rg |
rg-{project}-{env} |
90 |
| Virtual Network |
vnet |
vnet-{project}-{env} |
64 |
| Subnet |
snet |
snet-{purpose}-{env} |
80 |
| NSG |
nsg |
nsg-{purpose}-{env} |
80 |
| Key Vault |
kv |
kv-{short}-{env}-{suffix} |
24 |
| Storage Account |
st |
st{short}{env}{suffix} |
24 |
| App Service Plan |
asp |
asp-{project}-{env} |
40 |
| App Service |
app |
app-{project}-{env} |
60 |
| SQL Server |
sql |
sql-{project}-{env} |
63 |
| SQL Database |
sqldb |
sqldb-{project}-{env} |
128 |
| Static Web App |
stapp |
stapp-{project}-{env} |
40 |
| CDN / Front Door |
fd |
fd-{project}-{env} |
64 |
| Log Analytics |
log |
log-{project}-{env} |
63 |
| App Insights |
appi |
appi-{project}-{env} |
255 |
| Container App |
ca |
ca-{project}-{env} |
32 |
| Container Env |
cae |
cae-{project}-{env} |
60 |
| Cosmos DB |
cosmos |
cosmos-{project}-{env} |
44 |
| Service Bus |
sb |
sb-{project}-{env} |
50 |
Length-Constrained Resources
Key Vault and Storage Account have 24-char limits. Always include uniqueSuffix:
// Key Vault: kv-{8chars}-{3chars}-{6chars} = 21 chars max
var kvName = 'kv-${take(projectName, 8)}-${take(environment, 3)}-${take(uniqueSuffix, 6)}'
// Storage: st{8chars}{3chars}{6chars} = 19 chars max (no hyphens!)
var stName = 'st${take(replace(projectName, '-', ''), 8)}${take(environment, 3)}${take(uniqueSuffix, 6)}'
Naming Rules
- DO: Use lowercase with hyphens (
kv-myapp-dev-abc123)
- DO: Include
uniqueSuffix in globally unique names (Key Vault, Storage, SQL Server)
- DO: Use
take() to truncate long names within limits
- DON'T: Use hyphens in Storage Account names (only lowercase + numbers)
- DON'T: Hardcode unique values — always derive from
uniqueString(resourceGroup().id)
- DON'T: Exceed max length — Bicep won't warn, deployment will fail
Azure Verified Modules (AVM)
AVM-First Policy
- ALWAYS check AVM availability first via
mcp_bicep_list_avm_metadata
- Use AVM module defaults for SKUs when available
- If custom SKU needed, require live deprecation research
- NEVER hardcode SKUs without validation
- NEVER write raw Bicep for a resource that has an AVM module
Common AVM Modules
| Resource |
Module Path |
Min Version |
| Key Vault |
br/public:avm/res/key-vault/vault |
0.11.0 |
| Virtual Network |
br/public:avm/res/network/virtual-network |
0.5.0 |
| Storage Account |
br/public:avm/res/storage/storage-account |
0.14.0 |
| App Service Plan |
br/public:avm/res/web/serverfarm |
0.4.0 |
| App Service |
br/public:avm/res/web/site |
0.12.0 |
| SQL Server |
br/public:avm/res/sql/server |
0.10.0 |
| Log Analytics |
br/public:avm/res/operational-insights/workspace |
0.9.0 |
| App Insights |
br/public:avm/res/insights/component |
0.4.0 |
| NSG |
br/public:avm/res/network/network-security-group |
0.5.0 |
| Static Web App |
br/public:avm/res/web/static-site |
0.4.0 |
| Container App |
br/public:avm/res/app/container-app |
0.11.0 |
| Container Env |
br/public:avm/res/app/managed-environment |
0.8.0 |
| Cosmos DB |
br/public:avm/res/document-db/database-account |
0.10.0 |
| Front Door |
br/public:avm/res/cdn/profile |
0.7.0 |
| Service Bus |
br/public:avm/res/service-bus/namespace |
0.10.0 |
| Container Registry |
br/public:avm/res/container-registry/registry |
0.6.0 |
Finding Latest AVM Version
// Use Bicep MCP tool:
mcp_bicep_list_avm_metadata → filter by resource type → use latest version
// Or check: https://aka.ms/avm/index
AVM Usage Pattern
module keyVault 'br/public:avm/res/key-vault/vault:0.11.0' = {
name: '${kvName}-deploy'
params: {
name: kvName
location: location
tags: tags
enableRbacAuthorization: true
enablePurgeProtection: true
}
}
AVM Known Pitfalls
Region Limitations
| Service |
Limitation |
Workaround |
| Static Web Apps |
Only 5 regions: westus2, centralus, eastus2, westeurope, eastasia |
Use westeurope for EU |
| Azure OpenAI |
Limited regions per model |
Check availability before planning |
| Container Apps |
Most regions but not all |
Verify cae environment in target region |
Parameter Type Mismatches
Known issues when using AVM modules — verify before coding:
Log Analytics Workspace (operational-insights/workspace):
dailyQuotaGb is int in AVM, not string
- DO:
dailyQuotaGb: 5
- DON'T:
dailyQuotaGb: '5'
Container Apps Managed Environment (app/managed-environment):
appLogsConfiguration deprecated in newer versions
- DO: Use
logsConfiguration with destination object
- DON'T: Use
appLogsConfiguration.destination: 'log-analytics'
Container Apps (app/container-app):
scaleSettings is an object, not array of rules
- DO: Check AVM schema for exact object shape
- DON'T: Assume
scaleRules: [...] array format
SQL Server (sql/server):
sku parameter is a typed object {name, tier, capacity}
- DO: Pass full SKU object matching schema
- DON'T: Pass just string
'S0'
availabilityZone requires specific format per region
App Service (web/site):
APPINSIGHTS_INSTRUMENTATIONKEY deprecated
- DO: Use
APPLICATIONINSIGHTS_CONNECTION_STRING instead
- DON'T: Set instrumentation key directly
Key Vault (key-vault/vault):
softDeleteRetentionInDays is immutable after creation
- DO: Set correctly on first deploy (default: 90)
- DON'T: Try to change after vault exists
Static Web App (web/static-site):
- Free SKU may not be deployable via ARM in all regions
- DO: Use
Standard SKU for reliable ARM deployment
- DON'T: Assume Free tier works everywhere via Bicep
WAF Assessment Criteria
Scoring Scale
| Score |
Definition |
| 9-10 |
Exceeds best practices, production-ready |
| 7-8 |
Meets best practices with minor gaps |
| 5-6 |
Adequate but improvements needed |
| 3-4 |
Significant gaps, address before production |
| 1-2 |
Critical deficiencies, not production-ready |
Pillar Definitions
| Pillar |
Icon |
Focus Areas |
| Security |
🔒 |
Identity, network, data protection, threat detection |
| Reliability |
🔄 |
SLA, redundancy, disaster recovery, health monitoring |
| Performance |
⚡ |
Response time, scalability, caching, load testing |
| Cost |
💰 |
Right-sizing, reserved instances, monitoring spend |
| Operations |
🔧 |
IaC, CI/CD, monitoring, incident response, documentation |
Assessment Rules
- DO: Score each pillar 1-10 with confidence level (High/Medium/Low)
- DO: Identify specific gaps with remediation recommendations
- DO: Calculate composite WAF score as average of all pillars
- DON'T: Give perfect 10/10 scores without exceptional justification
- DON'T: Skip any pillar even if requirements seem light
- DON'T: Provide generic recommendations — be specific to the workload
Azure Pricing MCP Service Names
Exact names for the Azure Pricing MCP tool. Using wrong names returns 0 results.
| Azure Service |
Correct service_name |
Common SKUs |
| AKS |
Azure Kubernetes Service |
Free, Standard, Premium |
| API Management |
API Management |
Consumption, Developer, Standard |
| App Insights |
Application Insights |
Enterprise, Basic |
| App Service |
Azure App Service |
B1, S1, P1v3, P1v4 |
| Application Gateway |
Application Gateway |
Standard_v2, WAF_v2 |
| Azure Bastion |
Azure Bastion |
Basic, Standard |
| Azure DNS |
Azure DNS |
Public, Private |
| Azure Firewall |
Azure Firewall |
Standard, Premium |
| Azure Functions |
Functions |
Consumption, Premium |
| Azure Monitor |
Azure Monitor |
Logs, Metrics |
| Container Apps |
Azure Container Apps |
Consumption |
| Container Instances |
Container Instances |
Standard |
| Container Registry |
Container Registry |
Basic, Standard, Premium |
| Cosmos DB |
Azure Cosmos DB |
Serverless, Provisioned |
| Data Factory |
Azure Data Factory v2 |
Data Flow, Pipeline |
| Event Grid |
Event Grid |
Basic |
| Event Hubs |
Event Hubs |
Basic, Standard, Premium |
| Front Door |
Azure Front Door |
Standard, Premium |
| Key Vault |
Key Vault |
Standard |
| Load Balancer |
Load Balancer |
Basic, Standard |
| Log Analytics |
Log Analytics |
Per GB, Commitment Tier |
| Logic Apps |
Logic Apps |
Consumption, Standard |
| MySQL Flexible |
Azure Database for MySQL |
B1ms, D2ds_v4, E2ds_v4 |
| NAT Gateway |
NAT Gateway |
Standard |
| PostgreSQL Flexible |
Azure Database for PostgreSQL |
B1ms, D2ds_v4, E2ds_v4 |
| Redis Cache |
Azure Cache for Redis |
Basic, Standard, Premium |
| SQL Database |
SQL Database |
Basic, Standard, S0, S1, Premium |
| Service Bus |
Service Bus |
Basic, Standard, Premium |
| Static Web Apps |
Azure Static Web Apps |
Free, Standard |
| Storage |
Storage |
Standard, Premium, LRS, GRS |
| VPN Gateway |
VPN Gateway |
Basic, VpnGw1, VpnGw2 |
| Virtual Machines |
Virtual Machines |
D4s_v5, B2s, E4s_v5 |
- DO: Use exact names from the table above
- DON'T: Use "Azure SQL" (returns 0 results) — use "SQL Database"
- DON'T: Use "Web App" — use "Azure App Service"
Bulk Estimates
For multi-resource cost estimates, prefer azure_bulk_estimate over calling azure_cost_estimate
per resource. It accepts a resources array and returns aggregated totals.
Each resource supports a quantity parameter (default: 1) for multi-instance scenarios.
Use output_format: "compact" to reduce response size when detailed metadata is not needed.
Service Recommendation Matrix
Workload Patterns
| Pattern |
Cost-Optimized Tier |
Balanced Tier |
Enterprise Tier |
| Static Site |
SWA Free + Blob |
SWA Std + CDN + KV |
SWA Std + FD + KV + Monitor |
| API-First |
App Svc B1 + SQL Basic |
App Svc S1 + SQL S1 + KV |
App Svc P1v3 + SQL Premium + APIM |
| N-Tier Web |
App Svc B1 + SQL Basic |
App Svc S1 + SQL S1 + Redis + KV |
App Svc P1v4 + SQL Premium + Redis + FD |
| Serverless |
Functions Consumption |
Functions Premium + CosmosDB |
Functions Premium + CosmosDB + APIM |
| Container |
Container Apps Consumption |
Container Apps + ACR + KV |
AKS + ACR + KV + Monitor |
| Data Platform |
SQL Basic + Blob |
Synapse Serverless + ADLS |
Synapse Dedicated + ADLS + Purview |
Detection Signals
Map user language to workload pattern:
| User Says |
Likely Pattern |
| "website", "landing page", "blog" |
Static Site |
| "REST API", "microservices", "backend" |
API-First |
| "web app", "portal", "dashboard" |
N-Tier Web |
| "event-driven", "triggers", "webhooks" |
Serverless |
| "Docker", "Kubernetes", "containers" |
Container |
| "analytics", "data warehouse", "ETL" |
Data Platform |
Business Domain Signals
| Industry |
Common Compliance |
Default Security |
| Healthcare |
HIPAA |
Private endpoints, encryption at rest |
| Financial |
PCI-DSS, SOC 2 |
WAF, private endpoints, audit logging |
| Government |
FedRAMP, IL4/5 |
Azure Gov, private endpoints |
| Retail/E-commerce |
PCI-DSS |
WAF, DDoS protection |
| Education |
FERPA |
Data residency, access controls |
Company Size Heuristics
| Size |
Budget Signal |
Default Tier |
Security Posture |
| Startup (<50) |
"$50-200/mo" |
Cost-Optimized |
Basic managed identity |
| Mid-Market (50-500) |
"$500-2000/mo" |
Balanced |
Private endpoints, KV |
| Enterprise (500+) |
"$2000+/mo" |
Enterprise |
Full WAF compliance |
Industry Compliance Pre-Selection
| Industry |
Auto-Select |
| Healthcare |
HIPAA checkbox, private endpoints |
| Finance |
PCI-DSS + SOC 2, WAF required |
| Government |
Data residency, enhanced audit |
| Retail |
PCI-DSS if payments, DDoS |
Governance Discovery
MANDATORY Gate
Governance discovery is a hard gate. If Azure connectivity is unavailable or policies cannot
be fully retrieved (including management group-inherited), STOP and inform the user.
Do NOT proceed to implementation planning with incomplete policy data.
Discovery Commands (Ordered by Completeness)
1. REST API (MANDATORY — includes management group-inherited policies):
SUB_ID=$(az account show --query id -o tsv)
az rest --method GET \
--url "https://management.azure.com/subscriptions/\
${SUB_ID}/providers/Microsoft.Authorization/\
policyAssignments?api-version=2022-06-01" \
--query "value[].{name:name, \
displayName:properties.displayName, \
scope:properties.scope, \
enforcementMode:properties.enforcementMode, \
policyDefinitionId:properties.policyDefinitionId}" \
-o json
[!CAUTION]
az policy assignment list only returns subscription-scoped assignments.
Management group policies (often Deny/tag enforcement) are invisible to it.
ALWAYS use the REST API above as the primary discovery method.
2. Policy Definition Drill-Down (for each Deny/DeployIfNotExists):
# For built-in or subscription-scoped policies
az policy definition show --name "{guid}" \
--query "{displayName:displayName, \
effect:policyRule.then.effect, \
conditions:policyRule.if}" -o json
# For management-group-scoped custom policies
az policy definition show --name "{guid}" \
--management-group "{mgId}" \
--query "{displayName:displayName, \
effect:policyRule.then.effect}" -o json
# For policy set definitions (initiatives)
az policy set-definition show --name "{guid}" \
--query "{displayName:displayName, \
policyCount:policyDefinitions | length(@)}" -o json
3. ARG KQL (supplemental — subscription-scoped only):
PolicyResources
| where type == 'microsoft.authorization/policyassignments'
| where properties.enforcementMode == 'Default'
| project name, displayName=properties.displayName,
effect=properties.parameters.effect.value,
scope=properties.scope
| order by name asc
Azure Policy Discovery Workflow
Before creating implementation plans, discover active policies:
1. Verify Azure connectivity: az account show
2. REST API: Get ALL effective policy assignments (subscription + MG inherited)
3. Compare count with Azure Portal (Policy > Assignments) — must match
4. For each Deny/DeployIfNotExists: drill into policy definition JSON
5. Check tag enforcement policies (names containing 'tag' or 'Tag')
6. Check allowed resource types and locations
7. Document ALL findings in 04-governance-constraints.md
Common Policy Constraints
| Policy |
Impact |
Solution |
| Required tags |
Deployment fails without tags |
Include all 4 required tags |
| Allowed locations |
Resources rejected outside list |
Use swedencentral default |
| SQL AAD-only auth |
SQL password auth blocked |
Use azureADOnlyAuthentication: true |
| Storage shared key |
Shared key access denied |
Use managed identity RBAC |
| Zone redundancy |
Non-zonal SKUs rejected |
Use P1v4+ for App Service Plans |
Research Workflow (All Agents)
Standard 4-Step Pattern
- Validate Prerequisites — Confirm previous artifact exists. If missing, STOP.
- Read Agent Context — Read previous artifact for context. Read template for H2 structure.
- Domain-Specific Research — Query ONLY for NEW information not in artifacts.
- Confidence Gate (80% Rule) — Proceed at 80%+ confidence. Below 80%, ASK user.
Confidence Levels
| Level |
Indicators |
Action |
| High (80-100%) |
All critical info available |
Proceed |
| Medium (60-79%) |
Some assumptions needed |
Document assumptions, ask for critical gaps |
| Low (0-59%) |
Major gaps |
STOP — request clarification |
Context Reuse Rules
- DO: Read previous agent's artifact for context
- DO: Cache shared defaults (read once per session)
- DO: Query external sources only for NEW information
- DON'T: Re-query Azure docs for resources already in artifacts
- DON'T: Search workspace repeatedly (context flows via artifacts)
- DON'T: Re-validate previous agent's work (trust artifact chain)
Agent-Specific Research Focus
| Agent |
Primary Research |
Skip (Already in Artifacts) |
| Requirements |
User needs, business context |
— |
| Architect |
WAF gaps, SKU comparisons, pricing |
Service list (from 01) |
| Bicep Plan |
AVM availability, governance policies |
Architecture decisions (from 02) |
| Bicep Code |
AVM schemas, parameter types |
Resource list (from 04) |
| Deploy |
Azure state (what-if), credentials |
Template structure (from 05) |
Service Lifecycle Validation
AVM Default Trust
When using AVM modules with default SKU parameters:
- Trust the AVM default — Microsoft maintains these
- No additional deprecation research needed for defaults
- If overriding SKU parameter, run deprecation research
Deprecation Research (For Non-AVM or Custom SKUs)
| Source |
Query Pattern |
Reliability |
| Azure Updates |
azure.microsoft.com/updates/?query={service}+deprecated |
High |
| Microsoft Learn |
Check "Important" / "Note" callouts on service pages |
High |
| Azure CLI |
az provider show --namespace {provider} for API versions |
Medium |
| Resource Provider |
Check available SKUs in target region |
High |
Known Deprecation Patterns
| Pattern |
Status |
Replacement |
| "Classic" anything |
DEPRECATED |
ARM equivalents |
CDN Standard_Microsoft |
DEPRECATED 2027 |
Azure Front Door |
| App Gateway v1 |
DEPRECATED |
App Gateway v2 |
| "v1" suffix services |
Likely deprecated |
Check for v2 |
| Old API versions (2020-xx) |
Outdated |
Use latest stable API |
What-If Deprecation Signals
Deploy agent should scan what-if output for:
deprecated|sunset|end.of.life|no.longer.supported|classic.*not.*supported|retiring
If detected, STOP and report before deployment.
Template-First Output Rules
Mandatory Compliance
| Rule |
Requirement |
| Exact text |
Use template H2 text verbatim |
| Exact order |
Required H2s appear in template-defined order |
| Anchor rule |
Extra sections allowed only AFTER last required H2 |
| No omissions |
All template H2s must appear in output |
| Attribution |
Include > Generated by {agent} agent | {YYYY-MM-DD} |
Output Location
All agent outputs go to agent-output/{project}/:
| Step |
Output File |
Agent |
| 1 |
01-requirements.md |
Requirements |
| 2 |
02-architecture-assessment.md |
Architect |
| 3 |
03-des-*.{py,md} |
Design |
| 4 |
04-implementation-plan.md |
Bicep Plan |
| 4 |
04-governance-constraints.md |
Bicep Plan |
| 4 |
04-preflight-check.md |
Bicep Code (pre-flight) |
| 5 |
05-implementation-reference.md |
Bicep Code |
| 6 |
06-deployment-summary.md |
Deploy |
| 7 |
07-*.md (7 documents) |
azure-artifacts skill |
Header Format
# Step {N}: {Title} - {project-name}
> Generated by {agent} agent | {YYYY-MM-DD}
Validation Checklist
Before completing any agent task, verify:
1---2name: azure-defaults3description: Provides Azure defaults for naming, regions, tags, AVM-first modules, security baselines, WAF criteria, governance discovery, and pricing guidance across all agents.4license: MIT5---6
7# Azure Defaults Skill
8
9Single source of truth for all Azure infrastructure configuration used across agents.
10Replaces individual `_shared/` file lookups with one consolidated reference.
11
12---
13
14## Quick Reference (Load First)
15
16### Default Regions
17
18| Service | Default Region | Reason |
19| ------------------- | -------------------- | ----------------------------------- |
20| **All resources** | `swedencentral` | EU GDPR-compliant |
21| **Static Web Apps** | `westeurope` | Not available in swedencentral |
22| **Azure OpenAI** | `swedencentral` | Limited availability — verify first |
23| **Failover** | `germanywestcentral` | EU paired alternative |
24
25### Required Tags (Azure Policy Enforced)
26
27| Tag | Required | Example Values |
28| ------------- | -------- | ------------------------ |
29| `Environment` | Yes | `dev`, `staging`, `prod` |
30| `ManagedBy` | Yes | `Bicep` |
31| `Project` | Yes | Project identifier |
32| `Owner` | Yes | Team or individual name |
33
34Bicep pattern:
35
36```bicep
37tags: {
38 Environment: environment
39 ManagedBy: 'Bicep'
40 Project: projectName
41 Owner: owner
42}
43```
44
45### Unique Suffix Pattern
46
47Generate ONCE in `main.bicep`, pass to ALL modules:
48
49```bicep
50// main.bicep
51var uniqueSuffix = uniqueString(resourceGroup().id)
52
53module keyVault 'modules/key-vault.bicep' = {
54 params: { uniqueSuffix: uniqueSuffix }
55}
56```
57
58### Security Baseline
59
60| Setting | Value | Applies To |
61| -------------------------- | ------------------- | --------------------------------- |
62| `supportsHttpsTrafficOnly` | `true` | Storage accounts |
63| `minimumTlsVersion` | `'TLS1_2'` | All services |
64| `allowBlobPublicAccess` | `false` | Storage accounts |
65| `publicNetworkAccess` | `'Disabled'` (prod) | Data services |
66| Authentication | Managed Identity | Prefer over keys/strings |
67| SQL Auth | Azure AD-only | `azureADOnlyAuthentication: true` |
68
69---
70
71## CAF Naming Conventions
72
73### Standard Abbreviations
74
75| Resource | Abbreviation | Name Pattern | Max Length |
76| ---------------- | ------------ | --------------------------- | ---------- |
77| Resource Group | `rg` | `rg-{project}-{env}` | 90 |
78| Virtual Network | `vnet` | `vnet-{project}-{env}` | 64 |
79| Subnet | `snet` | `snet-{purpose}-{env}` | 80 |
80| NSG | `nsg` | `nsg-{purpose}-{env}` | 80 |
81| Key Vault | `kv` | `kv-{short}-{env}-{suffix}` | **24** |
82| Storage Account | `st` | `st{short}{env}{suffix}` | **24** |
83| App Service Plan | `asp` | `asp-{project}-{env}` | 40 |
84| App Service | `app` | `app-{project}-{env}` | 60 |
85| SQL Server | `sql` | `sql-{project}-{env}` | 63 |
86| SQL Database | `sqldb` | `sqldb-{project}-{env}` | 128 |
87| Static Web App | `stapp` | `stapp-{project}-{env}` | 40 |
88| CDN / Front Door | `fd` | `fd-{project}-{env}` | 64 |
89| Log Analytics | `log` | `log-{project}-{env}` | 63 |
90| App Insights | `appi` | `appi-{project}-{env}` | 255 |
91| Container App | `ca` | `ca-{project}-{env}` | 32 |
92| Container Env | `cae` | `cae-{project}-{env}` | 60 |
93| Cosmos DB | `cosmos` | `cosmos-{project}-{env}` | 44 |
94| Service Bus | `sb` | `sb-{project}-{env}` | 50 |
95
96### Length-Constrained Resources
97
98Key Vault and Storage Account have 24-char limits. Always include `uniqueSuffix`:
99
100```bicep
101// Key Vault: kv-{8chars}-{3chars}-{6chars} = 21 chars max
102var kvName = 'kv-${take(projectName, 8)}-${take(environment, 3)}-${take(uniqueSuffix, 6)}'
103
104// Storage: st{8chars}{3chars}{6chars} = 19 chars max (no hyphens!)
105var stName = 'st${take(replace(projectName, '-', ''), 8)}${take(environment, 3)}${take(uniqueSuffix, 6)}'
106```
107
108### Naming Rules
109
110- **DO**: Use lowercase with hyphens (`kv-myapp-dev-abc123`)
111- **DO**: Include `uniqueSuffix` in globally unique names (Key Vault, Storage, SQL Server)
112- **DO**: Use `take()` to truncate long names within limits
113- **DON'T**: Use hyphens in Storage Account names (only lowercase + numbers)
114- **DON'T**: Hardcode unique values — always derive from `uniqueString(resourceGroup().id)`
115- **DON'T**: Exceed max length — Bicep won't warn, deployment will fail
116
117---
118
119## Azure Verified Modules (AVM)
120
121### AVM-First Policy
122
1231. **ALWAYS** check AVM availability first via `mcp_bicep_list_avm_metadata`
1242. Use AVM module defaults for SKUs when available
1253. If custom SKU needed, require live deprecation research
1264. **NEVER** hardcode SKUs without validation
1275. **NEVER** write raw Bicep for a resource that has an AVM module
128
129### Common AVM Modules
130
131| Resource | Module Path | Min Version |
132| ------------------ | -------------------------------------------------- | ----------- |
133| Key Vault | `br/public:avm/res/key-vault/vault` | `0.11.0` |
134| Virtual Network | `br/public:avm/res/network/virtual-network` | `0.5.0` |
135| Storage Account | `br/public:avm/res/storage/storage-account` | `0.14.0` |
136| App Service Plan | `br/public:avm/res/web/serverfarm` | `0.4.0` |
137| App Service | `br/public:avm/res/web/site` | `0.12.0` |
138| SQL Server | `br/public:avm/res/sql/server` | `0.10.0` |
139| Log Analytics | `br/public:avm/res/operational-insights/workspace` | `0.9.0` |
140| App Insights | `br/public:avm/res/insights/component` | `0.4.0` |
141| NSG | `br/public:avm/res/network/network-security-group` | `0.5.0` |
142| Static Web App | `br/public:avm/res/web/static-site` | `0.4.0` |
143| Container App | `br/public:avm/res/app/container-app` | `0.11.0` |
144| Container Env | `br/public:avm/res/app/managed-environment` | `0.8.0` |
145| Cosmos DB | `br/public:avm/res/document-db/database-account` | `0.10.0` |
146| Front Door | `br/public:avm/res/cdn/profile` | `0.7.0` |
147| Service Bus | `br/public:avm/res/service-bus/namespace` | `0.10.0` |
148| Container Registry | `br/public:avm/res/container-registry/registry` | `0.6.0` |
149
150### Finding Latest AVM Version
151
152```text
153// Use Bicep MCP tool:
154mcp_bicep_list_avm_metadata → filter by resource type → use latest version
155
156// Or check: https://aka.ms/avm/index
157```
158
159### AVM Usage Pattern
160
161```bicep
162module keyVault 'br/public:avm/res/key-vault/vault:0.11.0' = {
163 name: '${kvName}-deploy'
164 params: {
165 name: kvName
166 location: location
167 tags: tags
168 enableRbacAuthorization: true
169 enablePurgeProtection: true
170 }
171}
172```
173
174---
175
176## AVM Known Pitfalls
177
178### Region Limitations
179
180| Service | Limitation | Workaround |
181| --------------- | --------------------------------------------------------------------------- | ----------------------------------------- |
182| Static Web Apps | Only 5 regions: `westus2`, `centralus`, `eastus2`, `westeurope`, `eastasia` | Use `westeurope` for EU |
183| Azure OpenAI | Limited regions per model | Check availability before planning |
184| Container Apps | Most regions but not all | Verify `cae` environment in target region |
185
186### Parameter Type Mismatches
187
188Known issues when using AVM modules — verify before coding:
189
190**Log Analytics Workspace** (`operational-insights/workspace`):
191
192- `dailyQuotaGb` is `int` in AVM, not `string`
193- **DO**: `dailyQuotaGb: 5`
194- **DON'T**: `dailyQuotaGb: '5'`
195
196**Container Apps Managed Environment** (`app/managed-environment`):
197
198- `appLogsConfiguration` deprecated in newer versions
199- **DO**: Use `logsConfiguration` with destination object
200- **DON'T**: Use `appLogsConfiguration.destination: 'log-analytics'`
201
202**Container Apps** (`app/container-app`):
203
204- `scaleSettings` is an object, not array of rules
205- **DO**: Check AVM schema for exact object shape
206- **DON'T**: Assume `scaleRules: [...]` array format
207
208**SQL Server** (`sql/server`):
209
210- `sku` parameter is a typed object `{name, tier, capacity}`
211- **DO**: Pass full SKU object matching schema
212- **DON'T**: Pass just string `'S0'`
213- `availabilityZone` requires specific format per region
214
215**App Service** (`web/site`):
216
217- `APPINSIGHTS_INSTRUMENTATIONKEY` deprecated
218- **DO**: Use `APPLICATIONINSIGHTS_CONNECTION_STRING` instead
219- **DON'T**: Set instrumentation key directly
220
221**Key Vault** (`key-vault/vault`):
222
223- `softDeleteRetentionInDays` is immutable after creation
224- **DO**: Set correctly on first deploy (default: 90)
225- **DON'T**: Try to change after vault exists
226
227**Static Web App** (`web/static-site`):
228
229- Free SKU may not be deployable via ARM in all regions
230- **DO**: Use `Standard` SKU for reliable ARM deployment
231- **DON'T**: Assume Free tier works everywhere via Bicep
232
233---
234
235## WAF Assessment Criteria
236
237### Scoring Scale
238
239| Score | Definition |
240| ----- | ------------------------------------------- |
241| 9-10 | Exceeds best practices, production-ready |
242| 7-8 | Meets best practices with minor gaps |
243| 5-6 | Adequate but improvements needed |
244| 3-4 | Significant gaps, address before production |
245| 1-2 | Critical deficiencies, not production-ready |
246
247### Pillar Definitions
248
249| Pillar | Icon | Focus Areas |
250| ----------- | ---- | -------------------------------------------------------- |
251| Security | 🔒 | Identity, network, data protection, threat detection |
252| Reliability | 🔄 | SLA, redundancy, disaster recovery, health monitoring |
253| Performance | ⚡ | Response time, scalability, caching, load testing |
254| Cost | 💰 | Right-sizing, reserved instances, monitoring spend |
255| Operations | 🔧 | IaC, CI/CD, monitoring, incident response, documentation |
256
257### Assessment Rules
258
259- **DO**: Score each pillar 1-10 with confidence level (High/Medium/Low)
260- **DO**: Identify specific gaps with remediation recommendations
261- **DO**: Calculate composite WAF score as average of all pillars
262- **DON'T**: Give perfect 10/10 scores without exceptional justification
263- **DON'T**: Skip any pillar even if requirements seem light
264- **DON'T**: Provide generic recommendations — be specific to the workload
265
266---
267
268## Azure Pricing MCP Service Names
269
270Exact names for the Azure Pricing MCP tool. Using wrong names returns 0 results.
271
272| Azure Service | Correct `service_name` | Common SKUs |
273| ------------------- | ------------------------------- | ------------------------------------------ |
274| AKS | `Azure Kubernetes Service` | `Free`, `Standard`, `Premium` |
275| API Management | `API Management` | `Consumption`, `Developer`, `Standard` |
276| App Insights | `Application Insights` | `Enterprise`, `Basic` |
277| App Service | `Azure App Service` | `B1`, `S1`, `P1v3`, `P1v4` |
278| Application Gateway | `Application Gateway` | `Standard_v2`, `WAF_v2` |
279| Azure Bastion | `Azure Bastion` | `Basic`, `Standard` |
280| Azure DNS | `Azure DNS` | `Public`, `Private` |
281| Azure Firewall | `Azure Firewall` | `Standard`, `Premium` |
282| Azure Functions | `Functions` | `Consumption`, `Premium` |
283| Azure Monitor | `Azure Monitor` | `Logs`, `Metrics` |
284| Container Apps | `Azure Container Apps` | `Consumption` |
285| Container Instances | `Container Instances` | `Standard` |
286| Container Registry | `Container Registry` | `Basic`, `Standard`, `Premium` |
287| Cosmos DB | `Azure Cosmos DB` | `Serverless`, `Provisioned` |
288| Data Factory | `Azure Data Factory v2` | `Data Flow`, `Pipeline` |
289| Event Grid | `Event Grid` | `Basic` |
290| Event Hubs | `Event Hubs` | `Basic`, `Standard`, `Premium` |
291| Front Door | `Azure Front Door` | `Standard`, `Premium` |
292| Key Vault | `Key Vault` | `Standard` |
293| Load Balancer | `Load Balancer` | `Basic`, `Standard` |
294| Log Analytics | `Log Analytics` | `Per GB`, `Commitment Tier` |
295| Logic Apps | `Logic Apps` | `Consumption`, `Standard` |
296| MySQL Flexible | `Azure Database for MySQL` | `B1ms`, `D2ds_v4`, `E2ds_v4` |
297| NAT Gateway | `NAT Gateway` | `Standard` |
298| PostgreSQL Flexible | `Azure Database for PostgreSQL` | `B1ms`, `D2ds_v4`, `E2ds_v4` |
299| Redis Cache | `Azure Cache for Redis` | `Basic`, `Standard`, `Premium` |
300| SQL Database | `SQL Database` | `Basic`, `Standard`, `S0`, `S1`, `Premium` |
301| Service Bus | `Service Bus` | `Basic`, `Standard`, `Premium` |
302| Static Web Apps | `Azure Static Web Apps` | `Free`, `Standard` |
303| Storage | `Storage` | `Standard`, `Premium`, `LRS`, `GRS` |
304| VPN Gateway | `VPN Gateway` | `Basic`, `VpnGw1`, `VpnGw2` |
305| Virtual Machines | `Virtual Machines` | `D4s_v5`, `B2s`, `E4s_v5` |
306
307- **DO**: Use exact names from the table above
308- **DON'T**: Use "Azure SQL" (returns 0 results) — use "SQL Database"
309- **DON'T**: Use "Web App" — use "Azure App Service"
310
311### Bulk Estimates
312
313For multi-resource cost estimates, prefer `azure_bulk_estimate` over calling `azure_cost_estimate`
314per resource. It accepts a `resources` array and returns aggregated totals.
315
316Each resource supports a `quantity` parameter (default: 1) for multi-instance scenarios.
317Use `output_format: "compact"` to reduce response size when detailed metadata is not needed.
318
319---
320
321## Service Recommendation Matrix
322
323### Workload Patterns
324
325| Pattern | Cost-Optimized Tier | Balanced Tier | Enterprise Tier |
326| ----------------- | -------------------------- | -------------------------------- | --------------------------------------- |
327| **Static Site** | SWA Free + Blob | SWA Std + CDN + KV | SWA Std + FD + KV + Monitor |
328| **API-First** | App Svc B1 + SQL Basic | App Svc S1 + SQL S1 + KV | App Svc P1v3 + SQL Premium + APIM |
329| **N-Tier Web** | App Svc B1 + SQL Basic | App Svc S1 + SQL S1 + Redis + KV | App Svc P1v4 + SQL Premium + Redis + FD |
330| **Serverless** | Functions Consumption | Functions Premium + CosmosDB | Functions Premium + CosmosDB + APIM |
331| **Container** | Container Apps Consumption | Container Apps + ACR + KV | AKS + ACR + KV + Monitor |
332| **Data Platform** | SQL Basic + Blob | Synapse Serverless + ADLS | Synapse Dedicated + ADLS + Purview |
333
334### Detection Signals
335
336Map user language to workload pattern:
337
338| User Says | Likely Pattern |
339| -------------------------------------- | -------------- |
340| "website", "landing page", "blog" | Static Site |
341| "REST API", "microservices", "backend" | API-First |
342| "web app", "portal", "dashboard" | N-Tier Web |
343| "event-driven", "triggers", "webhooks" | Serverless |
344| "Docker", "Kubernetes", "containers" | Container |
345| "analytics", "data warehouse", "ETL" | Data Platform |
346
347### Business Domain Signals
348
349| Industry | Common Compliance | Default Security |
350| ----------------- | ----------------- | ------------------------------------- |
351| Healthcare | HIPAA | Private endpoints, encryption at rest |
352| Financial | PCI-DSS, SOC 2 | WAF, private endpoints, audit logging |
353| Government | FedRAMP, IL4/5 | Azure Gov, private endpoints |
354| Retail/E-commerce | PCI-DSS | WAF, DDoS protection |
355| Education | FERPA | Data residency, access controls |
356
357### Company Size Heuristics
358
359| Size | Budget Signal | Default Tier | Security Posture |
360| ------------------- | -------------- | -------------- | ---------------------- |
361| Startup (<50) | "$50-200/mo" | Cost-Optimized | Basic managed identity |
362| Mid-Market (50-500) | "$500-2000/mo" | Balanced | Private endpoints, KV |
363| Enterprise (500+) | "$2000+/mo" | Enterprise | Full WAF compliance |
364
365### Industry Compliance Pre-Selection
366
367| Industry | Auto-Select |
368| ---------- | --------------------------------- |
369| Healthcare | HIPAA checkbox, private endpoints |
370| Finance | PCI-DSS + SOC 2, WAF required |
371| Government | Data residency, enhanced audit |
372| Retail | PCI-DSS if payments, DDoS |
373
374---
375
376## Governance Discovery
377
378### MANDATORY Gate
379
380Governance discovery is a **hard gate**. If Azure connectivity is unavailable or policies cannot
381be fully retrieved (including management group-inherited), STOP and inform the user.
382Do NOT proceed to implementation planning with incomplete policy data.
383
384### Discovery Commands (Ordered by Completeness)
385
386**1. REST API (MANDATORY — includes management group-inherited policies)**:
387
388```bash
389SUB_ID=$(az account show --query id -o tsv)
390az rest --method GET \
391 --url "https://management.azure.com/subscriptions/\
392${SUB_ID}/providers/Microsoft.Authorization/\
393policyAssignments?api-version=2022-06-01" \
394 --query "value[].{name:name, \
395displayName:properties.displayName, \
396scope:properties.scope, \
397enforcementMode:properties.enforcementMode, \
398policyDefinitionId:properties.policyDefinitionId}" \
399 -o json
400```
401
402> [!CAUTION]
403> `az policy assignment list` only returns subscription-scoped assignments.
404> Management group policies (often Deny/tag enforcement) are invisible to it.
405> **ALWAYS use the REST API above as the primary discovery method.**
406
407**2. Policy Definition Drill-Down (for each Deny/DeployIfNotExists)**:
408
409```bash
410# For built-in or subscription-scoped policies
411az policy definition show --name "{guid}" \
412 --query "{displayName:displayName, \
413effect:policyRule.then.effect, \
414conditions:policyRule.if}" -o json
415
416# For management-group-scoped custom policies
417az policy definition show --name "{guid}" \
418 --management-group "{mgId}" \
419 --query "{displayName:displayName, \
420effect:policyRule.then.effect}" -o json
421
422# For policy set definitions (initiatives)
423az policy set-definition show --name "{guid}" \
424 --query "{displayName:displayName, \
425policyCount:policyDefinitions | length(@)}" -o json
426```
427
428**3. ARG KQL (supplemental — subscription-scoped only)**:
429
430```kusto
431PolicyResources
432| where type == 'microsoft.authorization/policyassignments'
433| where properties.enforcementMode == 'Default'
434| project name, displayName=properties.displayName,
435 effect=properties.parameters.effect.value,
436 scope=properties.scope
437| order by name asc
438```
439
440### Azure Policy Discovery Workflow
441
442Before creating implementation plans, discover active policies:
443
444```text
4451. Verify Azure connectivity: az account show
4462. REST API: Get ALL effective policy assignments (subscription + MG inherited)
4473. Compare count with Azure Portal (Policy > Assignments) — must match
4484. For each Deny/DeployIfNotExists: drill into policy definition JSON
4495. Check tag enforcement policies (names containing 'tag' or 'Tag')
4506. Check allowed resource types and locations
4517. Document ALL findings in 04-governance-constraints.md
452```
453
454### Common Policy Constraints
455
456| Policy | Impact | Solution |
457| ------------------ | ------------------------------- | ------------------------------------- |
458| Required tags | Deployment fails without tags | Include all 4 required tags |
459| Allowed locations | Resources rejected outside list | Use `swedencentral` default |
460| SQL AAD-only auth | SQL password auth blocked | Use `azureADOnlyAuthentication: true` |
461| Storage shared key | Shared key access denied | Use managed identity RBAC |
462| Zone redundancy | Non-zonal SKUs rejected | Use P1v4+ for App Service Plans |
463
464---
465
466## Research Workflow (All Agents)
467
468### Standard 4-Step Pattern
469
4701. **Validate Prerequisites** — Confirm previous artifact exists. If missing, STOP.
4712. **Read Agent Context** — Read previous artifact for context. Read template for H2 structure.
4723. **Domain-Specific Research** — Query ONLY for NEW information not in artifacts.
4734. **Confidence Gate (80% Rule)** — Proceed at 80%+ confidence. Below 80%, ASK user.
474
475### Confidence Levels
476
477| Level | Indicators | Action |
478| --------------- | --------------------------- | ------------------------------------------- |
479| High (80-100%) | All critical info available | Proceed |
480| Medium (60-79%) | Some assumptions needed | Document assumptions, ask for critical gaps |
481| Low (0-59%) | Major gaps | STOP — request clarification |
482
483### Context Reuse Rules
484
485- **DO**: Read previous agent's artifact for context
486- **DO**: Cache shared defaults (read once per session)
487- **DO**: Query external sources only for NEW information
488- **DON'T**: Re-query Azure docs for resources already in artifacts
489- **DON'T**: Search workspace repeatedly (context flows via artifacts)
490- **DON'T**: Re-validate previous agent's work (trust artifact chain)
491
492### Agent-Specific Research Focus
493
494| Agent | Primary Research | Skip (Already in Artifacts) |
495| ------------ | ------------------------------------- | -------------------------------- |
496| Requirements | User needs, business context | — |
497| Architect | WAF gaps, SKU comparisons, pricing | Service list (from 01) |
498| Bicep Plan | AVM availability, governance policies | Architecture decisions (from 02) |
499| Bicep Code | AVM schemas, parameter types | Resource list (from 04) |
500| Deploy | Azure state (what-if), credentials | Template structure (from 05) |
501
502---
503
504## Service Lifecycle Validation
505
506### AVM Default Trust
507
508When using AVM modules with default SKU parameters:
509
510- Trust the AVM default — Microsoft maintains these
511- No additional deprecation research needed for defaults
512- If overriding SKU parameter, run deprecation research
513
514### Deprecation Research (For Non-AVM or Custom SKUs)
515
516| Source | Query Pattern | Reliability |
517| ----------------- | ---------------------------------------------------------- | ----------- |
518| Azure Updates | `azure.microsoft.com/updates/?query={service}+deprecated` | High |
519| Microsoft Learn | Check "Important" / "Note" callouts on service pages | High |
520| Azure CLI | `az provider show --namespace {provider}` for API versions | Medium |
521| Resource Provider | Check available SKUs in target region | High |
522
523### Known Deprecation Patterns
524
525| Pattern | Status | Replacement |
526| -------------------------- | ----------------- | --------------------- |
527| "Classic" anything | DEPRECATED | ARM equivalents |
528| CDN `Standard_Microsoft` | DEPRECATED 2027 | Azure Front Door |
529| App Gateway v1 | DEPRECATED | App Gateway v2 |
530| "v1" suffix services | Likely deprecated | Check for v2 |
531| Old API versions (2020-xx) | Outdated | Use latest stable API |
532
533### What-If Deprecation Signals
534
535Deploy agent should scan what-if output for:
536`deprecated|sunset|end.of.life|no.longer.supported|classic.*not.*supported|retiring`
537
538If detected, STOP and report before deployment.
539
540---
541
542## Template-First Output Rules
543
544### Mandatory Compliance
545
546| Rule | Requirement |
547| ------------ | ------------------------------------------------------ |
548| Exact text | Use template H2 text verbatim |
549| Exact order | Required H2s appear in template-defined order |
550| Anchor rule | Extra sections allowed only AFTER last required H2 |
551| No omissions | All template H2s must appear in output |
552| Attribution | Include `> Generated by {agent} agent \| {YYYY-MM-DD}` |
553
554### Output Location
555
556All agent outputs go to `agent-output/{project}/`:
557
558| Step | Output File | Agent |
559| ---- | -------------------------------- | ----------------------- |
560| 1 | `01-requirements.md` | Requirements |
561| 2 | `02-architecture-assessment.md` | Architect |
562| 3 | `03-des-*.{py,md}` | Design |
563| 4 | `04-implementation-plan.md` | Bicep Plan |
564| 4 | `04-governance-constraints.md` | Bicep Plan |
565| 4 | `04-preflight-check.md` | Bicep Code (pre-flight) |
566| 5 | `05-implementation-reference.md` | Bicep Code |
567| 6 | `06-deployment-summary.md` | Deploy |
568| 7 | `07-*.md` (7 documents) | azure-artifacts skill |
569
570### Header Format
571
572```markdown
573# Step {N}: {Title} - {project-name}
574
575> Generated by {agent} agent | {YYYY-MM-DD}
576```
577
578---
579
580## Validation Checklist
581
582Before completing any agent task, verify:
583
584- [ ] Output file saved to `agent-output/{project}/`
585- [ ] All required H2 headings from template are present
586- [ ] H2 headings match template text exactly
587- [ ] All 4 required tags included in resource definitions
588- [ ] Unique suffix used for globally unique names
589- [ ] Security baseline settings applied
590- [ ] Region defaults correct (swedencentral, or exception documented)
591- [ ] Attribution header included with agent name and date