Score:0

In an Azure Web App how can I bypass authentication for internal API endpoint calls?

cn flag

I have an Asp.Net Core application running in an Azure Web App and I need it to be able to call itself.

Part of a long-running process in the app needs to be able to open a connection to https://my-app-name.azurewebsites.net/api/check-for-updates.

This works fine in a public-facing environment, it failed on an IP-restricted one until I gave it local VNet access, and it doesn't work at all on an environment that relies on AD authentication. Instead I get a 401 forbidden message.

Is there any way of telling it that a request from localhost does not need to be authenticated? It would be fine if this was limited by endpoint.

One idea that crossed my mind was to use the Authentication service to manage identity with "allow anonymous" enabled and then use the Access Restriction panel to catch unauthenticated users from outside the local VNet. Unfortunately it looks as though the Access Restriction pane doesn't have an option to pick up on the Authentication status of a request, but a solution like that would be ideal.

ng flag
How are you implementing the Azure AD authentication? Are you using the App Service Easy Auth option?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.