Back to skills
SKILL.md
Azure Patterns
ASecurityWhen to activate: Azure, AKS, Azure Functions, App Service, SQL Database, Blob Storage, Key Vault, Azure AD, Application Insights, Bicep
- 2 stars
- 0 votes
- 0 copies
- 5 views
- Added October 26, 2026
Works with
Security analysis
100/100npx -y skills add Mattakushi432/Claude-Code-Skills-Custom-DevTools-Pack --skill azure-patterns --agent claude-codeAre you the author of Azure Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mattakushi432-azure-patterns)---
name: azure-patterns
description: "When to activate: Azure, AKS, Azure Functions, App Service, SQL Database, Blob Storage, Key Vault, Azure AD, Application Insights, Bicep"
origin: zakr
metadata:
namespace: zakr/devtools-pack
version: 1.0.0
category: devops
language: devops
platforms: [claude-code, codex, gemini-cli, cursor, aider, windsurf]
---
# Azure Patterns
## AKS Cluster (Bicep)
```bicep
resource aks 'Microsoft.ContainerService/managedClusters@2023-10-01' = {
name: 'myapp-aks'
location: resourceGroup().location
identity: { type: 'SystemAssigned' }
properties: {
dnsPrefix: 'myapp'
enableRBAC: true
aadProfile: {
managed: true
enableAzureRBAC: true
}
agentPoolProfiles: [
{
name: 'system'
count: 2
vmSize: 'Standard_D4s_v3'
osType: 'Linux'
mode: 'System'
enableAutoScaling: true
minCount: 2
maxCount: 5
}
]
networkProfile: {
networkPlugin: 'azure'
networkPolicy: 'azure'
}
addonProfiles: {
azureKeyvaultSecretsProvider: { enabled: true }
omsagent: {
enabled: true
config: { logAnalyticsWorkspaceResourceID: workspace.id }
}
}
}
}
```
## Azure Functions (Python)
```python
import azure.functions as func
import logging
app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION)
@app.route(route="orders/{order_id}", methods=["GET"])
@app.cosmos_db_input(
arg_name="order",
database_name="mydb",
container_name="orders",
id="{order_id}",
partition_key="{order_id}",
connection="CosmosDbConnectionSetting",
)
def get_order(req: func.HttpRequest, order: func.DocumentList) -> func.HttpResponse:
if not order:
return func.HttpResponse("Not found", status_code=404)
return func.HttpResponse(order[0].to_json(), mimetype="application/json")
```
## Key Vault Secrets in AKS
```yaml
# SecretProviderClass
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: myapp-secrets
spec:
provider: azure
parameters:
usePodIdentity: "false"
clientID: ${MANAGED_IDENTITY_CLIENT_ID}
keyvaultName: myapp-kv
objects: |
array:
- |
objectName: db-password
objectType: secret
tenantId: ${TENANT_ID}
secretObjects:
- secretName: myapp-secrets
type: Opaque
data:
- objectName: db-password
key: DB_PASSWORD
```
## Application Insights (SDK)
```python
from azure.monitor.opentelemetry import configure_azure_monitor
from opentelemetry import trace
configure_azure_monitor(
connection_string=os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
)
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("process-order") as span:
span.set_attribute("order.id", order_id)
result = process(order_id)
span.set_attribute("order.status", result.status)
```
## Azure DevOps Pipeline
```yaml
trigger:
branches:
include: [main]
pool:
vmImage: ubuntu-latest
variables:
- group: prod-secrets
- name: IMAGE_TAG
value: $(Build.SourceVersion)
stages:
- stage: Build
jobs:
- job: BuildAndPush
steps:
- task: Docker@2
inputs:
command: buildAndPush
repository: $(ACR_REPO)
containerRegistry: $(ACR_SERVICE_CONNECTION)
tags: $(IMAGE_TAG)
- stage: Deploy
dependsOn: Build
environment: production
jobs:
- deployment: DeployAKS
strategy:
runOnce:
deploy:
steps:
- task: KubernetesManifest@1
inputs:
action: deploy
manifests: k8s/*.yaml
containers: $(ACR_REPO):$(IMAGE_TAG)
```
## Key Rules
- Use Managed Identities instead of service principal secrets for AKS workloads
- Enable Defender for Containers on all AKS clusters
- Use Private Endpoints for Key Vault, Storage, and SQL in production
- Azure Policy: enforce tagging, region restrictions, and allowed VM sizes
- Application Insights sampling: set adaptive sampling to avoid cost overruns on high-traffic services
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.