带有服务标签的 Azure App Service 访问限制不起作用

Azure App Service access restrictions with service tag not working

我想将对我的一项应用服务的访问限制为 Azure API 管理。为了独立于单个 IP,我使用基于服务标签的限制创建了以下设置:

但是,如果我使用开发人员门户测试 API,我仍然会收到 403 条消息。

如果我现在添加限制规则以允许 API 管理的 IP 地址,它将起作用。

文档声称服务标签将所提供的 Azure 服务的 IP 范围添加到限制中。这正是我想要实现的,但它似乎不起作用。

在我联系了 MS 支持后,我知道可以给出答案。

答案中的中心信息是

Unfortunately, there is no tag for all of the API Management outbound IP addresses.

支持强调documentation for service tags指出

This enables customers to perform management operations on the APIs, Operations, Policies, NamedValues configured on the API Management service.

这意味着服务标签仅用于后端操作。问题在于它根本无法帮助您。我已经注意到,在我打开服务标签规则后,我无法通过门户网站使用直接 OpenAPI 端点更新 API,这是记录的方式。这是因为针对 OpenAPI 的探索性请求将使用本地浏览器作为 XHR 请求执行。这意味着我每次都必须将我的本地 IP 添加到限制列表中。

支持人员建议将所有内容放入 VNET 并使用此技术配置访问。我有这个解决方案,然后认为它太笨重了。我想我现在必须这样做了。