azure-cdn - 为自定义域启用 HTTPS 时,Azure CDN 失败并显示“不允许该操作”
问题描述
我正在尝试在 Azure CDN 的自定义域上启用 HTTPS,但是az
当我尝试以编程方式执行此操作时,PowerShell 和 API 都失败了。
{
"error": {
"code": "BadRequest",
"message": "That action isn’t allowed in this profile."
}
}
首先,我尝试通过 PowerShell。-Debug
注意:除非您使用开关,否则这会产生一个相当无用的错误-
Enable-AzCdnCustomDomainHttps -ResourceGroupName $resourceGroupName -ProfileName $profileName -EndpointName $endpointName -CustomDomainName $customDomainName -Debug
注意到az
我安装的 PowerShell 版本使用的是 API 版本2019-04-15,我开始调查是否有更新的 API 版本可用,并且有 - 2019-12-21。使用这个最新的 API,我在 PowerShell 之外运行了 HTTP 请求,但这导致了完全相同的错误。
curl --location --request POST 'https://management.azure.com/subscriptions/{{SubscriptionId}}/resourceGroups/{{ResourceGroup}}/providers/Microsoft.Cdn/profiles/{{CdnProfile}}/endpoints/{{CdnEndpoint}}/customDomains/{{CdnCustomDomain}}/enableCustomHttps?api-version=2019-12-31' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{BearerToken}}' \
--data-raw '{
"certificateSource": "Cdn",
"certificateSourceParameters": {
"certificateType": "Shared",
"@odata.type": "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters"
},
"protocolType": "IPBased"
}'
进一步挖掘,微软似乎在去年 8 月承认了这个问题,但随后迅速关闭了这个问题,没有实际修复它或提供解决方法。
有没有人能够为此提出解决方法?微软不费心去解决这个问题似乎是不可思议的,而且每次我们创建一个新的 CDN 时都依赖人工干预是不可持续的。
解决方案
看看这个线程: https ://github.com/Azure/azure-powershell/issues/9654 ,同样的问题出现在 UI 上,所以它似乎是 Azure 资源管理器中的一个错误。
在 UI 上,解决方案是以隐身模式打开。也许这是会话的问题,因此在 CLI 中再次注销应该也有帮助。
推荐阅读
- ansible - 如何在 ansible 查找模块中使用模式、年龄、年龄标记选项
- ios - iOS 12.4.1 发布在苹果商店拒绝 ipad 设备时崩溃
- visual-studio-2012 - VSCode 中的权限被拒绝(公钥)
- css - Angular Material datepicker上的占位符左边距/填充?
- android - 无法使用 Xamarin.UITest 截屏
- c++ - C++ 如何防止 Winapi::FreeLibrary 删除变量?
- hybris - 如何从 project.properties 文件设置为电子邮件
- elasticsearch - 脚本参数不支持以下类型的值:ElasticSearch v7.3 更新脚本中的 START_ARRAY
- acumos - 无法访问 Acumos 门户
- airflow - Airflow Xcom:如何将字节数组的值转换为 SQL 中的文本或 json 文本?