Azure-Functions: Can you use web.config restrictions (e.g. IP restriction or basic Auth)

IP Address Limitations for Azure Websites as protects a site with basic authentication. .

Are these or any other web.config methods possible for Azure functions, or should they be encoded?

I created web.config in the base of my wwwroot Azure function, but if I had done it correctly; he seems to be ignored.

EDIT: To clarify β€œWhy,” we have a QA site that should be accessible to internal and external testers. We would like to make the site inaccessible altogether, but really want people in several places to get access for testing.

However, we don’t know every last person who will be testing, so we can’t just turn on Azure AD Auth. We would prefer not to keep separate code to make it accessible.

+1
source share
2 answers

Some time passed, and the answer to this seemed to have changed. Although it is still not possible to directly do this with the web.config file, these platform features are now available on the Azure portal.

If you go to: https://portal.azure.com

And then go to:

App Services -> (Your Func App Name) -> Platform Features -> Networking -> Configure IP Restrictions 

You can configure IP restrictions here, and this will apply to your functional application.

Similarly, there are now several authentication options:

 App Services -> (Your Func App Name) -> Platform Features -> Authentication / Authorization 

This does not include basic authentication, but includes a bunch of things.

0
source

Web.config files do not apply to functional applications and are really (as you found) ignored.

Due to this limitation, functions that require web.config settings are not supported by the standard application application model (as you can see in the answer related to @Mikhail, there are workarounds), and there will currently be an alternative to fulfill this requirement in the code.

+3
source

Source: https://habr.com/ru/post/1012602/


All Articles