Ehsan Mahpour
Ehsan Mahpour

Reputation: 1

How to access secured API Management APIs linked to an Azure Static Web Application for local development with swa cli

How to call the secured API management linked APIs configured in azure portal when developing locally using SWA CLI? All I observed in the SWA configuration is meant for functions as APIs not the APIM.

https://learn.microsoft.com/en-us/azure/static-web-apps/apis-api-management

When adding API Management APIs to an azure static web app, an automatic proxy product is created on APIM securing access to the API for this app via /api prefix on the static web app domain. I did not see any mentions of how this works for local development to pass the user claims from SWA emulator to the API via that proxy?

Upvotes: 0

Views: 621

Answers (1)

Daniel Storey
Daniel Storey

Reputation: 943

I was trying to do this recently and I don't think it's possible. My solution was to add a proxy to my dev server (in my case vite) to proxy all requests to the /api route to the Api Management URL, setting the necessary subscription key header.

Upvotes: 0

Related Questions