Skip to content

Azd provisioning - #33

Merged
Ali Reza Farahnak (alfarahn) merged 17 commits into
mainfrom
azd-provisioning
Jul 1, 2026
Merged

Azd provisioning#33
Ali Reza Farahnak (alfarahn) merged 17 commits into
mainfrom
azd-provisioning

Conversation

@abymsft

Copy link
Copy Markdown
Collaborator

Summary

Type of change

  • Bug fix
  • New feature / new tool
  • Refactor
  • Documentation
  • Build / CI
  • Security

Checklist

  • Builds locally (dotnet build)
  • Frontend builds (npm run build in src/Dashboard/frontend)
  • No new secrets committed
  • No DELETE methods enabled in HTTP helpers
  • Updated .github/copilot-instructions.md if behaviour or structure changed
  • Updated CHANGELOG.md under [Unreleased]

Related issues

Closes #

Abishek Narayan (abymsft) and others added 6 commits May 10, 2026 16:58
Ignore compiled Bicep ARM output (keep *.parameters.json) and untrack the 3 stray artifacts (main.json, main-resources.json, modules/appservice.json). Ignore .pw-profile/ (Playwright profile w/ cookies), *.lscache, and .pw-social-preview-result.png. Add upload-social-preview.mjs maintainer utility.
Comment thread upload-social-preview.mjs

// Click "Edit" (or "Upload an image..." if no image is set yet).
const editBtn = page.getByRole('button', { name: /^edit$/i }).first();
const uploadBtn = page.getByRole('button', { name: /upload an image/i }).first();
…ions

gpt-5.4 is version 2026-03-05, not 2025-08-07 (that belongs to the original gpt-5) - the old pin would fail the AOAI model deployment. Also constrain location and aoaiLocation to the 29 regions where gpt-5.4 Global Standard is available (verified via az model catalog + Foundry region-availability docs) so azd up succeeds for any customer.
…ed-identity auth

Switch aoai.bicep from classic kind:OpenAI to kind:AIServices + allowProjectManagement (API 2026-03-01), matching the live finops-agent-ai resource. Grant the Web App MI 'Cognitive Services OpenAI User' (5e0bd9bd) instead of 'Cognitive Services User'. Keep disableLocalAuth:true - managed identity only, no API keys. Endpoint output (properties.endpoint) unchanged; prod confirms Copilot SDK BYOK works with the cognitiveservices.azure.com host. Docs updated.
Add infra/scripts/postdown.ps1 to remove the Entra app registration that preprovision creates - only when azd created it (AZURE_ENTRA_APP_CREATED_BY_AZD marker), never a bring-your-own AZURE_ENTRA_APP_ID. preprovision sets the marker and preserves it across azd up retries. Best-effort (exit 0 + continueOnError) so it never blocks teardown. Without this, every up/down cycle orphaned a multi-tenant app and secret. README and copilot-instructions updated.
…t hooks, classic-builder Dockerfile)

- Secretless: preprovision creates the Entra app with -NoSecret; postprovision federates the App Service MI to it (Workload Identity Federation). No client secret anywhere.

- Hooks: read azd env via 'azd env get-values -o json | ConvertFrom-Json -AsHashtable' (ConvertFrom-StringData broke on the App Insights connection string); force redirect-URI array with @().

- Dockerfile: drop BuildKit-only RUN --mount=type=cache so az acr build classic builder works (buildx prod build still works via registry cache).

- .dockerignore: **/node_modules/ (frontend/node_modules was bloating the context to 438MB).
…s CSP

CSRF middleware blocked POSTs from any host not in a hardcoded production allowlist, so /api/chat returned 403 on every azd deployment (app-finops-<token>.azurewebsites.net). Now allows same-origin writes (Origin/Referer host == request host).

CSP connect-src hardcoded the canadacentral App Insights endpoint, blocking frontend telemetry in other regions. Wildcarded to *.in.applicationinsights.azure.com and *.livediagnostics.monitor.azure.com.
…for GPT-5 reasoning

The session sets ReasoningEffort=xhigh on gpt-5.4 (GPT-5 series), which requires the Responses API. Provider was type=azure (Chat Completions, api-version 2024-10-21) with no /openai/v1/ path or WireApi, so reasoning requests never completed and chat hung forever. Switch to type=openai + {endpoint}/openai/v1/ + WireApi=responses per GitHub Copilot SDK BYOK docs for Azure AI Foundry. Also derive SEO/sitemap base URL from request host and gate IndexNow on PUBLIC_SITE_HOST so the template works on any deployment domain.
…ime limit

Default B1 had Always On off, so the app unloaded when idle and the next request paid an ~80s container cold start (looks like the agent is unresponsive). Enable Always On (supported on all allowed SKUs) and set WEBSITES_CONTAINER_START_TIME_LIMIT=1800 so the heavy node+.NET+Python+OTel image doesn't exceed the 230s default on first start.
… was hitting 429)

GlobalStandard capacity is a per-token-billed rate-limit knob (raising it is free). 30K TPM rate-limited the agent's xhigh reasoning + tool calls. Default now 100K; overridable via AZURE_OPENAI_MODEL_CAPACITY.
Template created the AIServices account + account-level gpt-5.4 deployment but no project, so nothing showed under the account in the AI Foundry portal. Add a Microsoft.CognitiveServices/accounts/projects resource (schema validated live) and surface AZURE_AI_PROJECT_NAME. Not required by the app runtime (BYOK calls the account /openai/v1/ endpoint) but completes the Foundry reference architecture.
# Conflicts:
#	src/Dashboard/Dockerfile
#	src/Dashboard/Program.cs

foreach (var kv in StaticFaqs)
urls += "<url><loc>https://azure-finops-agent.com/faq/" + kv.Key + "</loc><lastmod>" + today + "</lastmod><changefreq>monthly</changefreq><priority>0.8</priority></url>";
urls += "<url><loc>" + baseUrl + "/faq/" + kv.Key + "</loc><lastmod>" + today + "</lastmod><changefreq>monthly</changefreq><priority>0.8</priority></url>";

foreach (var kv in FaqTools.GetAll())
urls += "<url><loc>https://azure-finops-agent.com/faq/" + kv.Key + "</loc><lastmod>" + kv.Value.CreatedUtc + "</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>";
urls += "<url><loc>" + baseUrl + "/faq/" + kv.Key + "</loc><lastmod>" + kv.Value.CreatedUtc + "</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>";
@alfarahn
Ali Reza Farahnak (alfarahn) marked this pull request as ready for review July 1, 2026 11:03
@alfarahn
Ali Reza Farahnak (alfarahn) merged commit 2cf008f into main Jul 1, 2026
5 checks passed
@alfarahn
Ali Reza Farahnak (alfarahn) deleted the azd-provisioning branch July 1, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants