一键导入
n8n-azure
n8n workflow automation configuration for Azure. Use when deploying n8n specifically to Azure Container Apps.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
n8n workflow automation configuration for Azure. Use when deploying n8n specifically to Azure Container Apps.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Container Apps deployment gotchas and SPA frontend patterns for Azure. Supplements the official azure-prepare plugin skill with additional patterns for zone redundancy, azure.yaml configuration, and SPA frontend deployment (VITE_API_URL). USE FOR: Container Apps zone redundancy errors, managed-identity ACR pulls, azure.yaml language fields, cross-platform hooks, SPA frontend VITE_API_URL, React deployment to Azure, and ARM64-to-AMD64 builds. DO NOT USE FOR: generating complete Bicep infrastructure from scratch (use azure-prepare plugin) or AKS deployments (use superset-azure).
Run an agentic journey end-to-end: preflight the host, extract prompts, execute them in an isolated workspace, build, deploy to Azure, verify with real requests and screenshots, and clean up only owned resources. USE FOR: test a journey, run a journey end-to-end, validate journey prompts, deploy a journey to Azure, walk through a journey, execute journey steps, CI journey test. DO NOT USE FOR: creating new journeys (use journey-template), reviewing journey content (use content-reviewer), or modifying unrelated code.
Create new agentic journeys from app ideas. Generates README.md (learner walkthrough), PLAN.md (AI-readable spec), and app-specific skills for OSS deployments. Supports any stack (Node.js, Python, .NET, Java, Swift, Kotlin) and Azure service (Container Apps, AKS, Functions, App Service). USE FOR: new journey, scaffold journey, create learning experience, generate journey template, add journey to repo, build and deploy app to Azure, create journey README, generate PLAN.md spec, new OSS deployment, new full-stack journey, journey from idea. DO NOT USE FOR: modifying existing journeys (use coder), reviewing journey content (use content-reviewer), deploying apps (use oss-to-azure-deployer agent).
Run multiple journeys as a cross-platform test suite. Discover journeys, invoke journey-runner in isolated workspaces, deploy, verify, capture screenshots, clean up only owned Azure resources, and produce a consolidated report. USE FOR: test all journeys, regression test, CI journey validation, nightly journey test, end-to-end journey suite, validate journeys deploy correctly. DO NOT USE FOR: running one journey interactively (use journey-runner), creating journeys (use journey-template), or reviewing content (use content-reviewer).
Deploy Apache Superset on Azure. Use when deploying Superset for BI/data visualization with PostgreSQL backend.
Deploy Grafana OSS to Azure Container Apps. Use when deploying Grafana for metrics, logs, and traces visualization with optional PostgreSQL backend.
| name | n8n-azure |
| description | n8n workflow automation configuration for Azure. Use when deploying n8n specifically to Azure Container Apps. |
Application-specific configuration for deploying n8n to Azure Container Apps with PostgreSQL. Infrastructure should be generated fresh by the azure-prepare → azure-validate → azure-deploy pipeline.
Require Azure CLI, Azure Developer CLI 1.28.0 or later, and Node.js 24 LTS or later. Generated lifecycle hooks must be JavaScript (.mjs) or TypeScript (.ts) files referenced directly from azure.yaml; do not generate Bash-only .sh or PowerShell-only .ps1 hooks. See ../../../docs/tool-installation.md for Windows, macOS, and Linux installation options.
ALWAYS set AZURE_SUBSCRIPTION_ID explicitly before running azd up. Read it with az account show --query id -o tsv, then pass the returned value to azd env set AZURE_SUBSCRIPTION_ID <subscription-id>. Do not emit Bash command substitution when the operating system is unknown.
📖 See ../config/postgresql-avm-defaults.md for all PostgreSQL AVM gotchas (publicNetworkAccess, passwordAuth, HA, password pinning). Without these settings, n8n will fail with "authentication failed" or "connection timeout".
n8n-specific: Pin POSTGRES_PASSWORD and N8N_ENCRYPTION_KEY in the azd environment so redeployments keep the same values. Generate both with Node's crypto.randomBytes() or another cryptographically secure platform API. Do not require openssl, and do not create N8N_AUTH_PASSWORD; current n8n releases use built-in owner-account management rather than the removed N8N_BASIC_AUTH_* variables.
sku: { name: 'Standard_B1ms', tier: 'Burstable' } // Both fields required
# 1. Register providers (one-time per subscription)
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.DBforPostgreSQL
az provider register --namespace Microsoft.OperationalInsights
# 2. Create environment
azd env new my-n8n-env
# 3. Set required variables (replace placeholders with collected/generated values)
azd env set AZURE_SUBSCRIPTION_ID "<subscription-id>"
azd env set AZURE_LOCATION "westus"
azd env set POSTGRES_PASSWORD "<generated-secret>"
azd env set N8N_ENCRYPTION_KEY "<generated-secret>"
# 4. Deploy (~7-10 minutes)
azd up
# 5. Access n8n
azd env get-value N8N_URL
# First launch: complete the Set up owner account flow
Deployment time breakdown:
| File | Purpose |
|---|---|
config/environment-variables.md | All n8n environment variables for Azure |
config/health-probes.md | Health probe timing for n8n startup |
troubleshooting.md | Common issues and solutions |
graph TB
subgraph RG["Azure Resource Group"]
subgraph CAE["Container Apps Environment"]
N8N["n8n Container App<br/>(0-3 replicas)"]
end
LA["Log Analytics Workspace"]
PG["Azure PostgreSQL Flexible Server<br/>(Standard_B1ms/Burstable, 32GB, v16)"]
end
CAE -->|logs & metrics| LA
N8N -->|SSL/TLS port 5678| PG
| Setting | Value | Reason |
|---|---|---|
| Image | docker.io/n8nio/n8n:2.30.6 | Pin a tested official image; never use latest |
| Port | 5678 | n8n default port |
| CPU | 1.0 cores | Minimum for responsive UI |
| Memory | 2Gi | n8n recommended minimum |
| Min Replicas | 1 in CI, 0 after validation | CI needs deterministic readiness; scale-to-zero is fine for demos/cost after tests pass |
| Max Replicas | 3 | Handle traffic spikes |
n8n requires 60+ seconds to start. See config/health-probes.md.
Without proper health probes, containers will crash before n8n initializes!
Use the dedicated health endpoint /healthz for startup, readiness, and liveness probes. Do not probe /; the UI root can redirect or stall while the app is still initializing. When using the AVM Container App module, use startup.failureThreshold: 10 with startup.periodSeconds: 30 for a five-minute startup window, because AVM caps failureThreshold at 10.
| Resource | Monthly Cost |
|---|---|
| Container Apps (scale-to-zero) | ~$5-15 |
| PostgreSQL Flexible Server | ~$15 |
| Log Analytics | ~$2-5 |
| Total | ~$25-35/month |
After azd up, run the verification commands in troubleshooting.md. Key checks: HTTP 200 from $N8N_URL/healthz, HTTP 200 from the n8n UI URL, the owner-setup or login page renders, WEBHOOK_URL is set on the container, and container logs show no errors. In CI, poll /healthz for up to 5 minutes before checking the UI.
Generate infra-n8n/hooks/postprovision.js and reference it directly from azure.yaml:
hooks:
postprovision:
run: ./infra-n8n/hooks/postprovision.js
The hook must use child_process.execFileSync() or spawnSync() with argument arrays to call azd and az; it must not assemble shell command strings. Read the Container App FQDN, set WEBHOOK_URL=https://<fqdn>, and fail with a nonzero exit code if either CLI call fails. The update creates a replacement revision, so poll both /healthz and / for up to five minutes and require six consecutive HTTP 200 results over 30 seconds before returning. One successful probe is insufficient while Azure is deprovisioning the old revision. This works natively on Windows, macOS, and Linux.
When a module parameter receives uniqueString() output, declare its exact contract with @minLength(13) and @maxLength(13). This prevents false BCP334 name-length warnings in downstream resources.
azd down --force --purge
Note: Teardown takes 5-10 minutes (PostgreSQL deletion is slow).
initialDelaySeconds on liveness probe and a five-minute startup windowSSL_REJECT_UNAUTHORIZED=false for Azure PostgreSQLminReplicas: 1, probe /healthz, and wait for health before UI checksperiodSeconds: 30 with failureThreshold: 10 for 5 min windowUse these Azure MCP Server tools for n8n deployments:
| Tool | When to Use |
|---|---|
azure_bicep_schema | Get latest schemas for Microsoft.App/containerApps and Microsoft.DBforPostgreSQL/flexibleServers |
azure_deploy_architecture | Generate Mermaid architecture diagrams for the n8n deployment |
azure_deploy_plan | Validate the deployment plan before azd up — use target=ContainerApp |
azure_deploy_app_logs | Fetch container logs from Log Analytics when troubleshooting startup or connectivity issues |
This deployment has been tested multiple times and is verified working:
${VAR} syntax in main.parameters.json