azure - 通过 AzureCLI 启用对 Azure 应用服务的公共(public)访问

标签 azure powershell azure-web-app-service azure-cli appservice

我正在尝试更改应用程序服务上的访问限制设置,但我似乎找不到 AzureCLI 命令来执行此操作。目前应用程序服务设置为拒绝公共(public)访问,但是我正在寻找代码来将此设置更改为 true,以便我可以添加新的访问限制。我不想通过门户用户界面执行此操作。有谁知道需要传入什么命令或参数来更改此设置,我已经查看了 az webapp config access-restriction set 但这没有参数更改值。

Access Restrictions

最佳答案

您可以使用以下 cmdlet 启用对 azure webpp 的公共(public)网络访问。

az resource update --resource-group <resourceGroupName> --name <WebappName> --resource-type "Microsoft.Web/sites" --set properties.publicNetworkAccess=Enabled

我已经在 Cloud shell 中对此进行了测试,它工作正常。

以下是供您引用的示例输出:

enter image description here

关于azure - 通过 AzureCLI 启用对 Azure 应用服务的公共(public)访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76165869/

相关文章:

asp.net - 如何管理 Azure 应用服务中的(非 SSL)证书?

azure - 尝试通过另一个 Web 应用程序调用 Web 应用程序内的 API 时出现错误 - Azure

sql-server - Azure/Powershell : Checking to see if a SQL Server exists

powershell - Azure 文件共享不起作用

visual-studio - 如何加载 Azure 上 ASP.NET Core 的配置设置?

powershell - $ string.Substring索引/长度异常

sharepoint - Powershell 日期到 Sharepoint 日期

.net - 全局禁止 NuGet 还原作为 Azure DevOps 中其他 dotnet 命令的副作用

.net - 如何将配置文件引入 Powershell 脚本?

asp.net-mvc - Azure 门户中的应用程序设置不会覆盖通用值