Skip to content

Update Foundry Local CORS proxy endpoint#842

Open
MaanavD wants to merge 4 commits into
mainfrom
update-foundry-proxy-endpoint
Open

Update Foundry Local CORS proxy endpoint#842
MaanavD wants to merge 4 commits into
mainfrom
update-foundry-proxy-endpoint

Conversation

@MaanavD

@MaanavD MaanavD commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Old: https://onnxruntime-foundry-proxy-hpape7gzf2haesef.eastus-01.azurewebsites.net/api/foundryproxy
  • New: https://foundry-local-cors-proxy.azurewebsites.net/api/foundryproxy

Why

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 hardcoded FOUNDRY_API_ENDPOINT.
  • www/.env.example - update the commented PUBLIC_FOUNDRY_API_ENDPOINT example to match.

Verification

The new endpoint was smoke-tested after deployment:

  • OPTIONS preflight -> 204 with CORS headers (Access-Control-Allow-Origin: *, Access-Control-Allow-Methods: POST, OPTIONS).
  • POST with the website request shape -> 200 and returns Foundry Local model catalog entries.
  • Local website /models renders 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

MaanavD and others added 2 commits June 23, 2026 14:22
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>
Copilot AI review requested due to automatic review settings June 25, 2026 19:05
@MaanavD

MaanavD commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Replacement for fork PR #833. This PR uses an upstream branch so Vercel can deploy without the fork authorization gate.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Jun 25, 2026 10:39pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ENDPOINT constant in the model service to the new proxy URL.
  • Update the commented PUBLIC_FOUNDRY_API_ENDPOINT example in .env.example to 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>
Comment thread www/src/routes/models/service.ts Outdated
// 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';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest calling it foundry-local-cors-proxy unless it is a foundry wide service

@MaanavD

MaanavD commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

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>
@MaanavD MaanavD changed the title Update Foundry CORS proxy endpoint to foundry-cors-proxy Update Foundry Local CORS proxy endpoint Jun 25, 2026
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