Allow anonymous access to endpoint when using Azure Active Directory Authentication in a App Service

Viewed 2291

I have a web site running with Azure Active Directory Authentication. That means it requires any user to login before accessing any url of my site. This is all configured in azure and there is no code related to this in my project (which is webforms by the way...)

Now; is there a way for me to expose a single folder/file/endpoint within my site for anonymous access?

Current setup

1 Answers

The simple answer is No . According to Docs "The authentication and authorization module runs in the same sandbox as your application code. When it's enabled, every incoming HTTP request passes through it before being handled by your application code".

The work around is to allow every request and filter at your application code but you need to write code for that. You can find more about all this here https://docs.microsoft.com/en-us/azure/app-service/overview-authentication-authorization

If you just want to expose single end point while securing the whole application then its considerable effort to write the code for this. If the endpoint/operation you want to expose can be accommodated using Azure functions then take that path. You can write your logic in Az function and leave it open to handle anonymous requests.

Related