Azure Account Setup¶
Two accounts, one machine¶
This machine has two unrelated Azure accounts logged in. The personal account lives in ~/.azure/ (the default). The FTL account lives in an isolated config directory: ~/.azure-ftl/.
Every az command for FTL must use AZURE_CONFIG_DIR=~/.azure-ftl. A bare az command without this prefix goes to the wrong account.
FTL account details¶
| Field | Value |
|---|---|
| User | jetafifa2026@gmail.com |
| Subscription name | FootbalTradeLeage |
| Subscription ID | 8c48ba4e-7384-4579-a6e2-9aeb6c5a5de9 |
| Tenant | Default Directory |
| Config dir | ~/.azure-ftl/ |
| Credit | $200 Azure free credit (time-boxed) |
Warning
The subscription name is spelled FootbalTradeLeage — one l in Football, no u in League. This is the exact name in Azure. Match it literally when scripting.
Running az commands safely¶
Path A — prepend per command (safe in any shell):
AZURE_CONFIG_DIR=~/.azure-ftl az account show
AZURE_CONFIG_DIR=~/.azure-ftl az group create -n ftl-stg-rg-cin -l centralindia
Path B — source the env file once (for interactive sessions):
source ftl-infra/env.stg.sh # exports AZURE_CONFIG_DIR + sub ID + naming vars
az account show # now implicitly scoped to ~/.azure-ftl
The wrong way — bare az without the env file sourced:
Exception: read-only az commands you explicitly intend to run against the personal account may omit AZURE_CONFIG_DIR. Any mutation or resource creation without it set is a bug.
Verify identity before acting¶
Run this before any Azure operation in a session:
Expected output:
{"user": "jetafifa2026@gmail.com", "sub": "FootbalTradeLeage", "id": "8c48ba4e-7384-4579-a6e2-9aeb6c5a5de9"}
If any field differs, stop. The token has expired or the config dir is wrong. Re-login:
Budget and cost targets¶
FTL has $200 of Azure free credit. The budget is time-boxed — check remaining credit with:
Staging cost targets with scale-to-zero:
| Resource | Daily cost | Why it can't scale to zero |
|---|---|---|
| Redis Basic C0 | ~₹50/day | Always-on — no scale-to-zero option |
| ACR Basic | ~₹5/day | Always-on |
| Postgres Flex (stopped nightly) | ₹0 | scale-down.sh stops it each night |
| All Container Apps (scaled to zero) | ~₹0 | Achieved with overnight scale-down |
| Target blended daily | ~₹150/day | Applies scale-to-zero every night |
Warning
Azure auto-restarts a stopped Postgres Flex server after 7 days. Running scale-down.sh every night prevents this — it stops Postgres fresh each night before the 7-day clock can expire.
Deployment phases¶
Follow the phased deploy plan in ftl-docs/architecture/12-new-stack-architecture.md:
- P0/P1: staging SKUs only. Do not provision production-size Postgres Flex or Redis Standard.
- P2 (tournament launch): upgrade to production SKUs — Postgres production tier, Redis Standard C1 minimum.
Key resources by environment¶
| Resource type | Staging name | Resource group |
|---|---|---|
| Container Apps Environment | ftl-stg-cae-cin |
ftl-stg-rg-cin |
| api Container App | ftl-stg-api |
ftl-stg-rg-cin |
| ws Container App | ftl-stg-ws |
ftl-stg-rg-cin |
| flusher Container App | ftl-stg-flusher |
ftl-stg-rg-cin |
| frontend Container App | ftl-stg-frontend |
ftl-stg-rg-cin |
| Postgres Flex | ftl-stg-pg |
ftl-stg-rg-cin |
| Redis | (staging) | ftl-stg-rg-cin |
| ACR | ftlstgacrcin |
ftl-stg-rg-cin |
| Resource type | Prod name | Resource group |
|---|---|---|
| Container Apps Environment | ftl-prd-cae-cin |
ftl-prd-rg-cin |
| api Container App | ftl-prd-api |
ftl-prd-rg-cin |
| ws Container App | ftl-prd-ws |
ftl-prd-rg-cin |
| flusher Container App | ftl-prd-flusher |
ftl-prd-rg-cin |
| Postgres Flex | ftl-prd-pg |
ftl-prd-rg-cin |
Useful diagnostic commands¶
Check revision mode on a Container App:
AZURE_CONFIG_DIR=~/.azure-ftl az containerapp show \
-g ftl-stg-rg-cin -n ftl-stg-api \
--query 'properties.configuration.activeRevisionsMode' -o tsv
List all active revisions and their replica counts:
AZURE_CONFIG_DIR=~/.azure-ftl az containerapp revision list \
-g ftl-stg-rg-cin -n ftl-stg-api \
--query "[?properties.active].{name:name,min:properties.template.scale.minReplicas,traffic:properties.trafficWeight}" \
-o table
Check daily cost by resource (week-to-date):
AZURE_CONFIG_DIR=~/.azure-ftl az rest --method post \
--url "https://management.azure.com/subscriptions/8c48ba4e-7384-4579-a6e2-9aeb6c5a5de9/providers/Microsoft.CostManagement/query?api-version=2024-08-01" \
--body '{"type":"ActualCost","timeframe":"WeekToDate","dataset":{"granularity":"Daily","aggregation":{"totalCost":{"name":"PreTaxCost","function":"Sum"}}}}'