Azure API 管理 - 如何通过 PowerShell 命令启用 HTTP/2?

标签 azure powershell azure-api-management

我正在寻找正确的 PowerShell 语法来为 Azure API 管理实例启用 HTTP/2 设置。 enter image description here

我假设以某种方式this (New-AzApiManagementSslSetting) 一个,但是

a) 确切的语法是什么以及

b) 我是否也可以为现有实例启用它(就像您在门户中所做的那样)?

最佳答案

出于某种原因,PowerShell 命令对我不起作用,所以我使用 bash(和 jq)执行此操作。首先修改customProperties并将其存储在变量中:

customPropertiesNew=$(az apim show -n $APIM_NAME -g $APIM_RG --query customProperties | jq '."Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2" = "True"')

然后应用修改后的自定义属性(此步骤可能需要 7-14 分钟!):

az apim update -n $APIM_NAME -g $APIM_RG --set customProperties="$customPropertiesNew"

关于Azure API 管理 - 如何通过 PowerShell 命令启用 HTTP/2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60212290/

相关文章:

azure - 部署后无法更改 Azure Function 运行时版本

c# - 我可以在 Application Insights 中模拟数据(时间戳)吗?

powershell - 使用 Powershell 检查防火墙规则是否存在

python - Databricks/ADF python 帮助

c# - 在表存储中存储 ASP.NET MVC4 SimpleMembership 数据

powershell - 搜索事件查看器服务器 03 和 08 r2

html - 如何修改Powershell代码,以便仅为文件而非目录创建超链接?

azure - 更改已在使用的 APIM 订阅 key header 名称

azure - 如何配置Azure AD身份验证v2.0的权限

azure - 如何在azure api管理中使用订阅 key (主要/次要)获取用户详细信息?