gpt4 book ai didi

azure - 从Azure功能安全地调用Web Api

转载 作者:行者123 更新时间:2023-12-02 07:34:13 24 4
gpt4 key购买 nike

我有一个场景,我有 asp.net core web api 和 azure 函数。我每 1 小时从 azure 时间触发函数调用一次 Web api。我没有在 Web api 上启用身份验证,并且不希望公众访问它。只有我的 azure 函数应该能够访问 Web api。如何限制 Web api 从公共(public)访问,但只能从 azure 函数访问,而不实现身份验证。

我尝试了以下方法,在 webapi appsettings 文件中,我更新了“AllowedHosts”:“https://testfuntionapp.azurewebsites.net”。我的 testfuntionapp 无法通过此更改访问 Web api。

我正在尝试寻找一种具有成本效益的解决方案。

最佳答案

请检查我的发现是否有助于:

How can I restrict web api to access from public but only from azure function without implementing authentication.

这就是 Azure Virtual Networks 的位置来了。

创建虚拟网络,将 Azure Function 配置为只能在此 VNet 上调用,并且还可以配置核心应用对 VNet 的访问。

  • 通过使用专用端点,只能通过您的虚拟网络访问资源。
  • 如果启用虚拟网络集成,则 Azure Function 能够通过配置的专用终结点访问指定资源,这是更高级别的安全性。

引用文献:

关于azure - 从Azure功能安全地调用Web Api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72204406/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com