Azure AI Architecture Β· Reference Blueprint

Sphera AI Platform
PoC β†’ Production Blueprint

Full system blueprint to move the Sphera AI PoC to production on Microsoft Azure β€” component mapping, target architecture, code-issue remediation playbook, decision matrices, security & governance, and a 12-week migration roadmap.

Azure Claude / Anthropic RAG Databricks AI-DLC Hermes Agents
01Executive Brief Situation
Why the PoC is stuck, what "production-ready" means for AI on Azure, and the outcomes this blueprint delivers.
PoC
Current state
Production
Target state
12 wks
Migration window
#1 blocker
Code quality & security
πŸ“Œ The Situation as reported
  • Company: Sphera β€” enterprise ESG, sustainability & operational-risk software (data-heavy, compliance-sensitive).
  • Platform: Microsoft Azure is the approved cloud. AI PoC is built but cannot move to production.
  • Current components: Claude (Anthropic), nginx, AI-DLC (AI-Driven Development Life Cycle), Hermes agents, Git, RAG, Pendo, Juno*, Jina (embeddings/rerankers), Databricks, MS Teams.
  • Symptom: "Currently having code issue" β€” PoC code does not meet production bar (see Section 04 triage).
  • *Juno assumed to be an internal AI assistant / orchestration tool β€” confirm vendor & role in the Assumptions Register (Β§02).
Why PoCs stall (pattern): notebook/monolith code, hardcoded keys, no retry/rate-limit handling, no auth, no evals, no cost guardrails, direct vendor API calls, no IaC. The fix is architectural, not a code patch β€” this handbook is that fix.
🎯 What Production-Ready Means Here

βœ… Operable

Deploys repeatably (IaC), runs on containers/serverless, zero hardcoded secrets, health checks, autoscaling.

βœ… Observable

Every prompt, token, cost, latency, and eval trace is logged; alerts fire on drift & error rate.

βœ… Governed

Entra ID + RBAC, private networking, data residency, AIDLC stage gates, Responsible-AI guardrails.

βœ… Tested

Unit + integration + golden-set evals in CI; prompt & model versions pinned; rollback in minutes.

βœ… Cost-Controlled

Budget alerts, token caps, caching, model tiering (haiku/sonnet/opus by task).

βœ… User-Loved

Pendo in-app guidance + feedback loops; Teams human-in-the-loop approvals for high-stakes actions.

02Current-State Component Map As-Is
Every named component, its role today, and how it maps into the production blueprint. Colors = target layer.
Users & Channels Web Portal MS Teams (AI/Copilot) Pendo (guidance) Edge / Gateway nginx (reverse proxy) ⚠ no WAF · no rate limits · no mTLS AI / Agent Layer Hermes agents Juno* (assumed) RAG pipeline (Jina emb/rerank) ⚠ no guardrails · no tracing Data & Governance Databricks Lakehouse Git (code) AI-DLC lifecycle (gates) ⚠ secrets in repo · no IaC
Channels Gateway AI/Agent Data/Gov
🧩 Component β†’ Production Mapping 12 components
ComponentRole in PoCProduction Target on AzureAction
Claude / AnthropicLLM inference via direct APIClaude via Azure AI Foundry (enterprise control) β€” direct API as fallbackMigrate
nginxReverse proxyAzure Front Door + WAF at edge; Azure API Management (APIM) as gateway; nginx kept only for internal sidecarsReplace/split
AI-DLCAI Development Life Cycle processFormalize as stage-gate pipeline in Azure DevOps (define→data→build→verify→deploy→monitor)Formalize
Hermes agentsAgent orchestration & automationContainerized agent runtime on Azure Container Apps with Managed Identity + MCP tool registryContainerize
GitSource controlAzure DevOps / GitHub Enterprise β€” branch policy, PR gates, semantic releasesHarden
RAGRetrieval-augmented generationAzure AI Search (hybrid + semantic) with Jina embeddings/reranker; chunking & eval pipelineRebuild
PendoProduct analytics & in-app guidanceKeep β€” feed AI feature telemetry, feedback, and NPS into eval & improvement loopKeep
Juno*Assumed internal assistant/orchestratorConfirm vendor; fold into agent layer as an internal copilot surfaceVerify
Jina (jini)Embeddings / rerankersKeep for retrieval quality (or swap to Azure OpenAI text-embedding-3) β€” decision matrix Β§06Evaluate
DatabricksLakehouse, pipelines, MLKeep as data source of truth; Unity Catalog for lineage/ACL; sync to Azure AI SearchIntegrate
MS Teams (msteai)CollaborationTeams app with Adaptive Cards for human-in-the-loop approvals + bot notificationsExtend
AzureCloud platformEverything above lands on Azure: Entra ID, Key Vault, ACA/AKS, Monitor, AI FoundryCore
Assumptions Register: (1) Juno = internal AI assistant/orchestration tool β€” confirm vendor & API surface. (2) Jina = Jina AI embeddings-v3 / reranker-v1 used in the RAG stack. (3) AI-DLC = AI-Driven Development Life Cycle governance framework. (4) Sphera data is compliance-sensitive (ESG/emissions/risk) β†’ data residency & PII controls are first-class requirements. (5) "msteai" = MS Teams + AI/Copilot surface.
03Target-State Azure Blueprint To-Be
The full production architecture. Six layers: Edge β†’ Gateway β†’ Orchestration β†’ AI Services β†’ Data β†’ Observability/Governance, with CI/CD running alongside.
L1 Β· EDGE & CHANNELS Web Portal / SPA MS Teams App Pendo (in-app) Internal Copilot (Juno/Hermes) Azure Front Door+ WAF Β· DDoS Β· TLS 1.3 L2 Β· API GATEWAY (AUTHZ) Azure API Management (APIM) Entra ID Β· OAuth2/JWT Rate Limit Β· Quota Request Validation L3 Β· ORCHESTRATION & AGENTS Hermes Agent Runtime (ACA)MCP tools Β· cron Β· guardrails AI-DLC Pipelinestage gates Β· promote/demote Prompt & Model Registryversioned Β· deploy-gated Teams Approvalshuman-in-the-loop L4 Β· AI SERVICES Azure AI Foundry (Claude)managed identity Β· private net Azure AI Searchhybrid + semantic ranker Jina emb + rerankeror Azure OpenAI embeddings Guardrails + Evalsinjection filter Β· golden set L5 Β· DATA & LAKEHOUSE Databricks (Unity Catalog) Azure Data Lake Gen2 Key Vault (secrets) Cosmos/Postgres (state) L6 Β· OBSERVABILITY & GOVERNANCE App Insights + Tracing Cost alerts Β· Budgets CI/CD Β· GIT β†’ AZURE DEVOPS PR gates Β· lint Β· tests Bicep/Terraform IaC traces β†’ L6
Edge Gateway Orchestration AI Services Data Obs/Gov CI/CD
πŸ—οΈ Layer-by-Layer Guidance the blueprint
LayerKey Azure servicesWhyReplaces / upgrades
L1 EdgeFront Door + WAF, CDNGlobal TLS, DDoS, bot protection; single public entryBare nginx exposure
L2 GatewayAPIM, Entra IDOAuth2/JWT, rate limits, quotas, policy-based routing, per-key usagenginx as API gateway
L3 OrchestrationAzure Container Apps, Dapr, Service BusAgent runtime w/ managed identity, event-driven scale-to-zero, durable workflowsAd-hoc scripts & notebooks
L4 AI ServicesAzure AI Foundry (Claude), AI Search, Jina/embeddings, Azure OpenAIEnterprise LLM control plane: private networking, entitlements, content filters, evalsDirect Anthropic API calls
L5 DataDatabricks + Unity Catalog, Data Lake, Key Vault, Cosmos/PostgresSingle source of truth; lineage; secrets never in codeScattered CSVs / hardcoded keys
L6 ObservabilityApp Insights, Log Analytics, Grafana (optional), Pendo, cost alertsPrompt/token/cost/latency traces, eval dashboards, drift alarmsprint() debugging
CI/CDAzure DevOps / GitHub Actions, BicepEverything as code: infra, prompts, models, data pipelinesManual deploys
Key architectural decision: Put Claude behind Azure AI Foundry (same models, enterprise controls β€” private endpoints, managed identity, audit, entitlements, content safety). Keep the direct Anthropic API as a failover route behind the model-abstraction layer. This is the single highest-leverage move for a compliance-sensitive company.
04Code Triage Playbook The "Code Issue"
Ten blockers that keep AI PoC code out of production, each with a symptom β†’ root cause β†’ fix pattern β†’ guardrail. This is the section to hand the engineering team.
πŸ” Blocker #1 β€” Hardcoded Secrets & API Keys P0 Β· Security
  • Symptom: API keys in .py/.env committed to Git; keys rotate and break the PoC.
  • Root cause: Fast PoC iteration, no secret hygiene.
  • Fix: Azure Key Vault + Managed Identity (DefaultAzureCredential) β€” zero keys in code.
# ❌ PoC: key in code / .env
ANTHROPIC_API_KEY = "sk-ant-..."

# βœ… Prod: identity-based, no secret in code
from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

cred = DefaultAzureCredential()   # Managed Identity in prod, dev login locally
client = SecretClient(vault_url="https://sphera-ai.vault.azure.net/", credential=cred)
ANTHROPIC_API_KEY = client.get_secret("anthropic-api-key").value
Guardrail: secrets scanning in CI (gitleaks/trufflehog) + git filter-repo to purge history + deny-list file patterns in branch policy.
πŸ” Blocker #2 β€” No Retry / Rate-Limit Handling P0 Β· Reliability
  • Symptom: Random 429/5xx from Anthropic under load; jobs die mid-run; users see errors.
  • Root cause: Raw client.messages.create() with no retry, no backoff, no fallback model.
  • Fix: Retry with exponential backoff + jitter, circuit breaker, and a model/route fallback chain.
from tenacity import retry, stop_after_attempt, wait_exponential_jitter, retry_if_exception_type
import httpx

@retry(
    stop=stop_after_attempt(5),
    wait=wait_exponential_jitter(initial=1, max=60),
    retry=retry_if_exception_type((httpx.HTTPStatusError, ConnectionError)),
    reraise=True,
)
def call_llm(model: str, messages: list[dict]) -> str:
    # ... invoke via AI Foundry gateway, fallback to Anthropic direct on timeout
    return response

# Circuit breaker: if error_rate > 10% in 60s β†’ route to fallback model for 5 min
Guardrail: never call the LLM provider directly from app code β€” always through a gateway/client wrapper that owns retry, fallback, budget, and tracing.
πŸ” Blocker #3 β€” Monolith Notebook / Script Sprawl P1 Β· Maintainability
  • Symptom: One giant notebook or main.py; nobody can test it; imports are a tangle.
  • Root cause: PoC written as a linear experiment, never refactored.
  • Fix: Package by layer: ingest/ Β· retrieval/ Β· llm/ Β· agents/ Β· api/ Β· eval/, typed interfaces, no business logic in notebooks.
sphera-ai/
β”œβ”€β”€ pyproject.toml            # pinned deps (uv/poetry)
β”œβ”€β”€ src/sphera_ai/
β”‚   β”œβ”€β”€ config.py             # pydantic-settings (env-driven, validated)
β”‚   β”œβ”€β”€ retrieval/            # chunking, embeddings, search
β”‚   β”œβ”€β”€ llm/                  # gateway client, prompt templates, fallback
β”‚   β”œβ”€β”€ agents/               # Hermes/tool orchestration, MCP registry
β”‚   β”œβ”€β”€ api/                  # FastAPI routes (thin)
β”‚   └── eval/                 # golden sets, scorers
└── tests/                    # unit + integration + eval (run in CI)
Guardrail: 80% coverage gate in CI; notebooks only as analysis artifacts, never as the runtime.
πŸ” Blocker #4 β€” No Input/Output Validation P1 Β· Robustness
  • Symptom: LLM returns malformed JSON β†’ KeyError crashes; garbage in β†’ hallucinated garbage out.
  • Root cause: Free-form json.loads() on model output.
  • Fix: Structured output (tool-use / Pydantic) + retry-on-parse-failure.
from pydantic import BaseModel, Field
from typing import Literal

class TradeSignal(BaseModel):
    action: Literal["buy", "sell", "hold"]
    confidence: float = Field(ge=0.0, le=1.0)
    reasoning: str

# model called with response_format / tool schema β†’ parse with .model_validate()
# on ValidationError β†’ one retry with "fix your output" prompt, else degrade to hold
πŸ” Blocker #5 β€” Prompt Injection & Untrusted Inputs P0 Β· Security
  • Symptom: RAG documents or user fields containing "ignore previous instructions"; model exfiltrates data.
  • Root cause: No isolation between instructions, data, and user input; no output filtering.
  • Fix: Delimiters + instruction hierarchy, input sanitization, output guardrails (PII/secret regex), least-privilege tool access, human approval for high-impact tool calls.
Guardrail: treat all retrieved content as untrusted data, never instructions. Tools must re-validate arguments server-side. Log every tool call.
πŸ” Blocker #6 β€” No Observability / Tracing P1 Β· Ops
  • Symptom: "It worked yesterday" β€” no logs, no traces, no token/cost accounting.
  • Root cause: print() debugging in a serverless world.
  • Fix: Structured logging + OpenTelemetry spans per request: prompt hash, model, tokens, latency, cost, retrieval ids.
import logging, time, opentelemetry.trace as trace

tracer = trace.get_tracer("sphera-ai")
logger = logging.getLogger("sphera_ai.llm")

with tracer.start_as_current_span("llm.call") as span:
    t0 = time.perf_counter()
    resp = call_llm(model, messages)
    span.set_attributes({
        "llm.model": model, "llm.prompt_hash": sha256(str(messages)),
        "llm.tokens_in": resp.usage.input_tokens, "llm.tokens_out": resp.usage.output_tokens,
        "llm.latency_ms": int((time.perf_counter()-t0)*1000),
        "llm.cost_usd": estimate_cost(model, resp.usage),
    })
logger.info("llm_call", extra={"model": model, "tokens": resp.usage})
Guardrail: every LLM call is traceable to (user, request, prompt version, model, cost) β€” this is also your audit story for compliance.
πŸ” Blocker #7 β€” Unversioned Prompts & Models P1 Β· Reproducibility
  • Symptom: Results change between runs; can't roll back a bad prompt; "which model was this?"
  • Root cause: Prompts inline in code, model names hardcoded, no registry.
  • Fix: Prompt templates as versioned artifacts in Git (or a prompt registry); model versions pinned in config; prompt/model deploy = release with rollback.
# config: pinned, environment-specific
model:
  primary: "claude-sonnet-4-6@2026-06-01"   # pinned via AI Foundry deployment
  fallback: "claude-haiku-4-5@2026-06-01"
  embedding: "jina-embeddings-v3@latest-validated"

prompt_version: "summary-v2-2026-08-01"
πŸ” Blocker #8 β€” No Tests / No Evals P1 Β· Quality
  • Symptom: Every change is a gamble; regressions discovered by users.
  • Root cause: "Evals are hard" β†’ skipped.
  • Fix: Golden-set evals in CI (50–200 curated Q/A with rubric scorers), LLM-as-judge with guardrail, regression gates on answer quality, latency, cost, hallucination rate. Start small; grow the set with Pendo-flagged bad answers.
Pattern: eval results are the acceptance test for promoting a prompt/model. No eval improvement β†’ no deploy (AIDLC gate).
πŸ” Blocker #9 β€” Unbounded Cost & Latency P2 Β· Cost
  • Symptom: Bill spikes; slow responses; users complain.
  • Root cause: Huge contexts, no caching, no model tiering, no budgets.
  • Fix: Prompt caching (Anthropic + AI Foundry support), model tiering by task (haiku for classification, sonnet for generation), token caps, response caching for identical queries, Azure budget alerts at 50/80/100%.
πŸ” Blocker #10 β€” No Auth / No RBAC P0 Β· Security
  • Symptom: Anybody with the URL can query the API; internal data exposed.
  • Root cause: PoC had no identity layer.
  • Fix: Entra ID SSO (OAuth2 PKCE for SPA), APIM validates JWT, role-based authorization per capability (viewer/analyst/admin), per-tenant data isolation checks.
Triage order: P0s first (#1, #2, #5, #10 β€” security & reliability), then P1s (#3, #4, #6, #7, #8), then P2 (#9). Each fix lands as a PR with a test and a guardrail β€” that is how the PoC earns "production" in 4–6 weeks.
05RAG Pipeline Design Retrieval
Production RAG: ingestion β†’ chunking β†’ embeddings (Jina) β†’ hybrid search (Azure AI Search) β†’ rerank β†’ grounded generation with citations and evals.
Ingest Databricks β†’ Data Lake Chunk & Embed semantic/late chunking Β· Jina v3 Azure AI Search hybrid: BM25 + vector + semantic Rerank jina-reranker-v1 (top-5) Grounded Generation (Claude) citations Β· "I don't know" Β· source links Guardrails + Eval groundedness Β· injection Β· PII User Question rewrite β†’ query β†’ filter (tenant) feedback (Pendo) β†’ eval set growth
πŸ“ RAG Design Decisions gotchas
DecisionRecommendationRationale
ChunkingSemantic chunking (150–400 tokens), metadata-rich; late chunking for long docsBetter retrieval than fixed-size; keeps citations intact
SearchHybrid (BM25 + vector + semantic ranker) via Azure AI SearchESG docs mix terminology & exact IDs β€” lexical+semantic beats either alone
EmbeddingsJina embeddings-v3 (multilingual, Matryoshka) or Azure OpenAI text-embedding-3-largeMultilingual ESG content; evaluate on your golden set (Β§06 matrix)
Rerankjina-reranker-v1 on top-20 β†’ top-5+10–20% answer quality for a few ms; cheap insurance
TenancyIndex per tenant + filterable tenant_id field; RBAC enforced in appCompliance β€” Sphera data is per-customer sensitive
FreshnessIncremental indexer from Databricks (Change Data Capture); daily + on-demandEmissions/safety data must not go stale
EvalsGolden set 50β†’200 Q/A; metrics: faithfulness, answer relevance, context precision/recall, citation accuracyEvery RAG change is a PR with an eval delta
Azure AI Search vs Databricks vector search: AI Search wins for the RAG serving path (hybrid + semantic + SLA + managed). Databricks stays the compute/curation plane. Keep one canonical index writer owned by the ingestion pipeline.
06Decision Matrices Trade-offs
Seven build-vs-buy / this-vs-that decisions the team is facing right now. Win = recommended choice for Sphera's context.
βš–οΈ M1 Β· Model Access: Azure AI Foundry vs Direct Anthropic API
FactorAI Foundry (win)Direct Anthropic API
Enterprise controlsPrivate endpoints, entitlements, auditVendor-only controls
Compliance (ESG data)Azure compliance + data residency storySeparate DPA/compliance scope
Managed identity / networkingFirst-class Azure integrationKeys + egress needed
Feature velocitySlight lag behind Anthropic releasesSame-day new models
CostAzure commitments/EA discountsList price
VerdictPrimary = AI Foundry; keep direct API as failover behind abstraction layer
βš–οΈ M2 Β· Gateway: Azure APIM vs Keep nginx
FactorAPIM (win)nginx only
OAuth2/JWT validationNative Entra integrationManual/openresty work
Rate limits & quotasPer-key, per-plan, built-inCustom Lua/limits
Analytics per consumerBuilt-in + export to App InsightsCustom access-log parsing
Operational simplicityAnother managed serviceAlready running
VerdictAPIM for external/internal API surface; nginx stays only as an ingress sidecar (e.g., local dashboards)
βš–οΈ M3 Β· Compute: Azure Container Apps vs AKS vs Azure Functions
FactorContainer Apps (win)AKSFunctions
Team size / K8s expertiseNo cluster managementFull cluster opsZero infra
Long-running agents / workflowsDurable, scale-to-zero, DaprFull controlExecution limits
Managed identity + VNetBuilt-inVia workload identityBuilt-in
Cost at low volumeScale-to-zeroNode minimumsPer-execution
VerdictACA for the agent/API tier; Functions for event-driven ingestion triggers; AKS only if the team grows a platform team
βš–οΈ M4 Β· Vector Search: Azure AI Search vs Databricks Vector Search
FactorAI Search (win for serving)Databricks Vector Search
Hybrid + semantic rankingBM25 + vector + semantic out of the boxVector only (v recent)
Serving SLA / latencyManaged search SLA, low latencyCompute-dependent
Ecosystem (indexers, skills)Azure-native indexers, enrichmentsDelta Lake integration great
VerdictAI Search = serving index; Databricks = curation & feature plane feeding it
βš–οΈ M5–M7 Β· Quick Calls
DecisionRecommendationWhy
M5 Β· Embeddings: Jina vs Azure OpenAIEvaluate both on your golden set; Jina if multilingual/late-chunking mattersQuality delta is domain-specific β€” let evals decide, keep provider behind an interface
M6 Β· Secrets: Key Vault vs .envKey Vault + Managed IdentityNon-negotiable for compliance (also feeds Β§04 blocker #1)
M7 Β· Observability: App Insights + Langfuse-style tracing vs DIYManaged tracing (Langfuse Cloud/OSS or Azure Monitor GenAI tracing)Prompt/token/cost trace out of the box; DIY logs drift and die
07Security & Governance Guardrails
Identity, network, data, and process controls β€” the layer that unlocks production approval for compliance-sensitive AI.

πŸ” Identity & Access

Entra ID SSO (PKCE) for apps; APIM JWT validation; RBAC roles: AI-Viewer / AI-Analyst / AI-Admin; Managed Identity for all service-to-service calls; Conditional Access for admin.

🌐 Network

Hub-spoke VNet; Private Endpoints for AI Foundry, AI Search, Key Vault, Databricks; Front Door + WAF (OWASP rules, geo-filter); no public egress except allowlisted providers.

πŸ—„οΈ Data Protection

Data classification (public/internal/confidential/PII); PII redaction before LLM context; per-tenant isolation; retention & deletion policies; Azure Purview for lineage.

🧠 AI-Specific Controls

Prompt-injection filters; output guardrails (PII, secrets, prohibited content); tool-call allowlists; human approval for write actions; audit log of every model call & tool invocation.

πŸ›‘οΈ AI-DLC Stage Gates (production approval = gates passed)
GateExit criteriaOwner
G1 Β· DefineUse case, success metrics, risk tier, data inventory signed offProduct + Architect
G2 Β· DataData sources catalogued; PII flagged; lineage in Unity Catalog; consent/residency verifiedData Eng
G3 Β· BuildCode passes lint/tests/secrets scan; prompts versioned; abstraction layer in placeEngineering
G4 Β· VerifyGolden-set evals green; security review; load test; cost estimate approvedQA + Security
G5 Β· DeployBlue/green or canary; rollback runbook; runbook tested in dry-runPlatform
G6 Β· MonitorDashboards live; drift & cost alerts; feedback loop (Pendo) feeding eval set; monthly reviewOps + Product
Pattern: a model/prompt "promotion" is a release artifact that must pass G4 before touching production traffic. This is how "PoC β†’ Prod" stops being an opinion and becomes a checklist.
🧾 Compliance Checklist (ESG/enterprise context)
  • ☐ Data residency β€” region pin (e.g., EU/US) enforced at storage & inference
  • ☐ DPA with Anthropic (and Azure) covering sub-processors
  • ☐ Zero-retention or short-retention model settings where applicable
  • ☐ Audit log: who asked what, which model answered, what was retrieved
  • ☐ Model cards & system cards for each deployed use case (Responsible AI)
  • ☐ Incident response runbook for prompt-injection / data-exposure events
  • ☐ Pen test + threat model before GA; quarterly red team of the RAG path
08Observability & Operations Run It
What to measure, what to alert on, and how Pendo + Teams close the loop between users, evals, and model improvement.
πŸ“Š The AI Service Dashboard (one pane)
< 3s
P95 latency
> 99%
Groundedness
< 2%
Error rate
$ / day
Cost per use case
NPS / CSAT
From Pendo
  • Latency: per-model, per-feature; alert on P95 breach.
  • Quality: online evals (LLM-as-judge on sampled traffic) + offline golden set each deploy.
  • Cost: per use case, per tenant; budgets with 50/80/100% alerts; token caps per key.
  • Drift: input distribution, retrieval hit-rate, "I don't know" rate, hallucination proxy (groundedness score).
  • Feedback: Pendo thumbs up/down + comments β†’ weekly triage β†’ eval set growth β†’ model/prompt improvement (AIDLC loop).
🀝 Teams as the Control Surface
  • Adaptive Cards for human-in-the-loop approvals (e.g., agent-proposed actions, sensitive queries).
  • Bot notifications: eval regressions, cost spikes, drift alarms, weekly AI report.
  • Prompt-injection or PII incident β†’ Teams channel with severity + runbook link.
  • Users ask in Teams β†’ same governed pipeline (APIM β†’ agents β†’ AI Foundry). One platform, one audit trail.
πŸ”„ Incident & Rollback Runbook (summary)
  1. Detect: error-rate / cost / groundedness alert fires (App Insights β†’ Teams).
  2. Triage: trace lookup by request id; classify (model, prompt, retrieval, infra).
  3. Mitigate: feature flag off / rollback to previous prompt+model release (registry = instant).
  4. Post-mortem: add regression to golden set; AIDLC gate re-run before re-promotion.
09Migration Roadmap 12 Weeks
Four phases, each with exit criteria. The PoC is production-live by week 12 with zero re-architecture β€” only hardening.
W1–2Foundation W3–6Harden W7–10Migrate W11–12GA + scale

🟠 Phase 1 Β· Foundation (W1–2)

IaC landing zone (Bicep): VNet, Key Vault, Entra app regs, APIM, AI Foundry workspace, budgets. Secrets scan + git history purge. Exit: empty environment deploys from one command.

πŸ”΅ Phase 2 Β· Harden Code (W3–6)

Refactor into sphera-ai package; P0 fixes (#1,#2,#5,#10); abstraction layer; tests + golden-set evals in CI; prompt registry. Exit: CI green on every PR; eval baseline recorded.

🟣 Phase 3 Β· Migrate (W7–10)

Move LLM calls to AI Foundry (fallback chain); rebuild RAG on AI Search + Jina; Databricks β†’ incremental indexer; teams approvals; tracing live. Exit: parallel-run parity (95% answer match, no PII leaks).

🟒 Phase 4 Β· GA & Scale (W11–12)

Canary β†’ 100% traffic; SLOs + dashboards + runbooks; Pendo feedback loop live; security review + pen test sign-off; cost monitoring in place. Exit: production approval (G1–G6 all green).

Parallel-run trick: run PoC and production side-by-side on the same traffic, compare answers with an LLM-judge. "95% parity" is the evidence that convinces stakeholders β€” much stronger than a slide.
10Glossary & Cheat Sheet Reference
Key terms in 60 seconds, then the one-page cheat sheet for daily reference.

Azure AI Foundry

Azure's unified AI platform β€” model catalog (incl. Claude), deployments, entitlements, evals, content safety.

AI-DLC

AI-Driven Development Life Cycle — stage-gate framework (Define→Data→Build→Verify→Deploy→Monitor) for governing AI releases.

APIM

Azure API Management β€” gateway with auth, rate limits, quotas, policies, analytics.

RAG

Retrieval-Augmented Generation β€” ground model answers in your data via retrieval, reducing hallucination.

Managed Identity

Azure service identity with automatic credential rotation β€” replaces API keys in code.

Golden Set

Curated Q/A test set with rubric scoring β€” the acceptance test for prompt/model changes.

Groundedness

Eval metric: is the answer supported by retrieved context? (hallucination inverse)

MCP

Model Context Protocol β€” standard for connecting agents to tools/data (Hermes uses MCP tool registry).

Hybrid Search

Keyword (BM25) + vector search combined β€” best for mixed terminology/data (ESG docs).

Human-in-the-Loop

Approval step for high-stakes agent actions β€” e.g., Teams Adaptive Card before a write operation.

Unity Catalog

Databricks governance β€” lineage, ACLs, and data discovery across the lakehouse.

Scale-to-Zero

Serverless containers that shut down when idle β€” cuts PoC-stage cost to near zero.

⚑ One-Page Cheat Sheet

The printable quick reference (also standalone at /sphera-cheatsheet β€” download PDF, or use the print button):

RuleOne-liner
#1 SecretsNever in code β†’ Key Vault + Managed Identity
#2 CallsAlways via gateway wrapper: retry Β· fallback Β· budget Β· trace
#3 ModelsPin versions; registry; deploy = release with rollback
#4 PromptsVersioned artifacts; treat retrieved data as untrusted
#5 OutputPydantic/structured; validate; retry-on-parse; degrade safely
#6 EvalGolden set in CI; no eval improvement β†’ no deploy
#7 TracePrompt hash, tokens, cost, latency per call β†’ App Insights
#8 TenancyPer-tenant isolation at index + RBAC + query filter
#9 CostModel tiering + caching + budgets at 50/80/100%
#10 GateNothing to prod without AIDLC G1–G6 sign-off
Bottom line: the PoC is stuck on code quality, not on the idea. Fix the ten blockers (4 weeks), stand up the target architecture with IaC (2 weeks), migrate behind a fallback chain and prove parity (4 weeks), then GA with evals, budgets, and runbooks (2 weeks). Twelve weeks from "cannot move to prod" to a governed, observable, cost-controlled AI platform on Azure.