$npx -y skills add DanWahlin/github-azure-agentic-journeys --skill superset-azureDeploy Apache Superset on Azure. Use when deploying Superset for BI/data visualization with PostgreSQL backend.
| 1 | # Apache Superset on Azure Skill |
| 2 | |
| 3 | Deploy Apache Superset data visualization platform on Azure Kubernetes Service. |
| 4 | |
| 5 | > **Complexity Note**: Superset is the most complex deployment in this project due to psycopg2 requirements and AKS architecture. Deploy time: ~15-20 minutes. |
| 6 | |
| 7 | ## Prerequisites and Portability |
| 8 | |
| 9 | Require Azure CLI, Azure Developer CLI 1.28.0 or later, and Node.js 24 LTS or later. Verify `az version`, `azd version`, and `node --version` before generating infrastructure. The host must not need `kubectl` or Helm. Installation options for Windows, macOS, and Linux are in `../../../docs/tool-installation.md`. |
| 10 | |
| 11 | Generate the AKS post-provision workflow as `infra-superset/hooks/postprovision.js` and reference it directly from `azure.yaml`. The hook must attach the Kubernetes manifests and a remote deployment script to `az aks command invoke`. Run Helm and `kubectl` inside Azure. Invoke `az` and `azd` with argument arrays. On macOS and Linux, call each executable directly. On Windows, use the static PowerShell runner and JSON environment payload defined by the `container-apps-deployment` skill so Azure CLI `.cmd` shims aren't launched directly. Reject double quotes for every Windows target and additional shell metacharacters or CR/LF for `.cmd`/`.bat`; use attached scripts for complex remote commands. Do not generate a Bash-only host hook. |
| 12 | |
| 13 | Start the long deployment command with `--no-wait`, parse the returned command ID, and poll `az aks command result`. Require `provisioningState` to equal `Succeeded` and `exitCode` to equal `0`. Use a separate short AKS run command to read the ingress IP so URL discovery does not depend on long-command log truncation. |
| 14 | |
| 15 | Write generated Kubernetes Secret values to a mode-`0600` temporary manifest as base64 data. Attach the temporary bundle to AKS run command, do not print the values, delete the remote Secret manifest immediately after `kubectl apply`, and remove the local bundle in `finally` after success or failure. |
| 16 | |
| 17 | The hook owns `SUPERSET_SECRET_KEY` and `SUPERSET_ADMIN_PASSWORD`. On a clean environment, generate cryptographically random values for either missing setting, persist each with `azd env set`, never print the values, and reuse existing values on reruns. A first deployment must not depend on undocumented manual secret setup. |
| 18 | |
| 19 | ## Critical: Infrastructure Generation |
| 20 | |
| 21 | This skill provides Superset-specific configuration only. Infrastructure (Bicep, azure.yaml, K8s manifests) should be generated fresh each time by the official `azure-prepare` → `azure-validate` → `azure-deploy` pipeline. Do NOT rely on pre-existing infra code. |
| 22 | |
| 23 | ## Critical: Subscription Context |
| 24 | |
| 25 | **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 use Bash command substitution when the host OS is unknown. |
| 26 | |
| 27 | Without this, azd and Azure MCP tools will fail silently or produce incomplete deployments. |
| 28 | |
| 29 | ## Critical: PostgreSQL AVM Defaults |
| 30 | |
| 31 | **📖 See [../config/postgresql-avm-defaults.md](../config/postgresql-avm-defaults.md) for all PostgreSQL AVM gotchas** (publicNetworkAccess, passwordAuth, HA, password pinning). Without these, Superset will fail with "authentication failed" or "connection timeout". |
| 32 | |
| 33 | **Superset-specific:** Pin `POSTGRES_PASSWORD`, `SUPERSET_SECRET_KEY`, and `SUPERSET_ADMIN_PASSWORD` in the azd environment. Generate them with Node's `crypto.randomBytes()` or another cryptographically secure platform API. Do not require `openssl`, which is not installed by default on Windows. |
| 34 | |
| 35 | ## Critical: AKS AVM Module Defaults |
| 36 | |
| 37 | ```bicep |
| 38 | module aksCluster 'br/public:avm/res/container-service/managed-cluster:0.9.0' = { |
| 39 | params: { |
| 40 | disableLocalAccounts: false // Default requires AAD — fails without it |
| 41 | primaryAgentPoolProfiles: [ |
| 42 | { name: 'system', availabilityZones: [] } // westus doesn't support AZ |
| 43 | ] |
| 44 | } |
| 45 | } |
| 46 | ``` |
| 47 | |
| 48 | ## Quick Start (Verified) |
| 49 | |
| 50 | ```text |
| 51 | # 1. Register providers (one-time per subscription) |
| 52 | az provider register --namespace Microsoft.ContainerService |
| 53 | az provider register --namespace Microsoft.DBforPostgreSQL |
| 54 | az provider register --namespace Microsoft.OperationalInsights |
| 55 | |
| 56 | # 2. Create environment |
| 57 | azd env new my-superset-env |
| 58 | |
| 59 | # 3. Set required variables (replace placeholders with collected/generated values) |
| 60 | azd env set AZURE_SUBSCRIPTION_ID "<subscription-id>" |
| 61 | azd env set AZURE_LOCATION "westus" |
| 62 | azd env set POSTGRES_PASSWORD "<generated-secret>" |
| 63 | azd env set SUPERSET_SECRET_KEY "<generated-secret>" |
| 64 | azd env set SUPERSET_ADMIN_PASSWORD "<generated-secret>" |
| 65 | |
| 66 | # 4. Deploy (~15-20 minutes) |
| 67 | azd up |
| 68 | |
| 69 | # 5. Access Superset |
| 70 | azd env get-value SUPERSET_URL |
| 71 | # Login: admin / value returned by azd env get-value SUPERSET_ADMIN_PASSWORD |
| 72 | ``` |
| 73 | |
| 74 | **Deployment time breakdown:** |
| 75 | - Resource |