Update Foundry Local CORS proxy endpoint#842
Conversation
Repoint the website's model catalog proxy from the old onnxruntime-foundry-proxy Function App to the newly deployed foundry-cors-proxy Function App. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Creates a no-op commit to request a fresh Vercel deployment for PR #833 without changing source content. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Replacement for fork PR #833. This PR uses an upstream branch so Vercel can deploy without the fork authorization gate. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR repoints the Foundry Local website's model-catalog CORS proxy from the old Azure Function App (onnxruntime-foundry-proxy-...) to a newly deployed one (foundry-cors-proxy.azurewebsites.net). It fits into the website's static deployment flow, where the Azure Function acts as a CORS proxy to the Azure AI Foundry model catalog API. This replaces fork-based PR #833 to avoid the Vercel fork authorization gate.
Changes:
- Update the hardcoded
FOUNDRY_API_ENDPOINTconstant in the model service to the new proxy URL. - Update the commented
PUBLIC_FOUNDRY_API_ENDPOINTexample in.env.exampleto match.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
www/src/routes/models/service.ts |
Updates the hardcoded CORS proxy endpoint constant used by all model catalog fetches. |
www/.env.example |
Updates the commented example endpoint to keep documentation in sync with the code. |
The Azure Functions host intercepts CORS preflight OPTIONS requests before the proxy function runs and returns 204 with no Access-Control-Allow-Origin header, so the browser blocks the cross-origin model catalog request from the Vercel-hosted site. Send the proxy POST as a CORS 'simple request' (Content-Type: text/plain instead of application/json). The browser then skips the preflight entirely, and the actual POST response already includes Access-Control-Allow-Origin: *. The proxy parses the body as JSON regardless of Content-Type, so forwarding to the Foundry API is unaffected. Verified end-to-end against the live proxy: /models renders 46 models, all proxy POSTs return 200, no preflight OPTIONS, and the browser console is free of CORS errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| // Azure Function endpoint for CORS proxy | ||
| const FOUNDRY_API_ENDPOINT = | ||
| 'https://onnxruntime-foundry-proxy-hpape7gzf2haesef.eastus-01.azurewebsites.net/api/foundryproxy'; | ||
| 'https://foundry-cors-proxy.azurewebsites.net/api/foundryproxy'; |
There was a problem hiding this comment.
Suggest calling it foundry-local-cors-proxy unless it is a foundry wide service
|
Azure rename note: Azure Function App names cannot be renamed in place, so changing \oundry-cors-proxy\ to \oundry-local-cors-proxy\ requires creating a replacement Function App and redeploying the proxy. I verified \oundry-local-cors-proxy\ is available, but creation is currently blocked by missing permission \Microsoft.Storage/storageAccounts/listKeys/action\ on \ndrproxyprcasngu\ in \oundry-local-rg. I left the code endpoint unchanged until the replacement app exists, so the PR remains deployable. |
Point the website model catalog at the renamed foundry-local-cors-proxy Function App. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces #833 to move this PR off the fork branch and avoid the Vercel fork authorization gate.
Original fork PR: #833
What
Repoints the website's Foundry Local model catalog CORS proxy from the old Function App to the renamed Foundry Local proxy:
https://onnxruntime-foundry-proxy-hpape7gzf2haesef.eastus-01.azurewebsites.net/api/foundryproxyhttps://foundry-local-cors-proxy.azurewebsites.net/api/foundryproxyWhy
The proxy now uses Foundry Local naming in Azure and in the website code. The new Azure Function App (
foundry-local-cors-proxy) is live and serving the same anonymous CORS proxy contract for the Azure AI Foundry Local model catalog API.Changes
www/src/routes/models/service.ts- update the hardcodedFOUNDRY_API_ENDPOINT.www/.env.example- update the commentedPUBLIC_FOUNDRY_API_ENDPOINTexample to match.Verification
The new endpoint was smoke-tested after deployment:
OPTIONSpreflight ->204with CORS headers (Access-Control-Allow-Origin: *,Access-Control-Allow-Methods: POST, OPTIONS).POSTwith the website request shape ->200and returns Foundry Local model catalog entries./modelsrenders model cards using the renamed proxy endpoint.Anonymous access only - no auth token required, consistent with the previous deployment.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com