本文介绍了Azure-Functions:您可以使用 web.config 限制(例如 IP 限制或基本身份验证)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure 网站的 IP 限制 可能是 正在使用基本身份验证保护网站..

这些或任何其他 web.config 技术是否可以在 Azure Functions 上使用,或者是否需要对其进行编码?

Are these, or any other web.config techniques possible on Azure Functions or do they need to be coded?

我在 Azure 函数的 wwwroot 的基础上创建了一个 web.config,但如果我做得对的话;它似乎被忽略了.

I created a web.config in the base of my wwwroot of an Azure Function, but if I did it right; it appears to be ignored.

为了进一步阐明为什么",我们有一个需要内部和外部测试人员访问的 QA 站点.我们想让该网站一般不可用,但真的希望能够让几个地点的人们访问以进行测试.

To further clarify "Why", we have a QA site that needs to be accessible by internal and external testers. We'd like to make the site generally not available, but really want to be able to give people at a few locations access for testing.

但是,我们不知道将要进行测试的每一个人,因此我们不能只启用 Azure AD 身份验证.我们也宁愿不维护单独的代码以使其可用.

We don't know every last person that will be doing the testing, however, so we can't just enable the Azure AD Auth. We'd also rather not maintain separate code just to make this available.

推荐答案

已经有一段时间了,这个问题的答案已经改变了.虽然仍然无法通过 web.config 文件直接执行此操作,但这些平台功能现在可以在 Azure 门户中使用.

Its been some time and the answer to this has kind of changed. While its still not possible to directly do this with a web.config file, these platform features are now available in the Azure Portal.

如果您导航到:https://portal.azure.com

然后转到:

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

您可以在此处配置 IP 限制,它将应用于您的函数应用.

You can configure IP restrictions here and it will apply to your function app.

同样,现在有几个身份验证选项:

Similarly, there are now several authentication options under:

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

这不包括基本身份验证,但确实包括一堆东西.

This doesn't include basic auth, but it does include a bunch of stuff.

这篇关于Azure-Functions:您可以使用 web.config 限制(例如 IP 限制或基本身份验证)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:35