Azure 的解决方案:New-AzCdnProfile: Operation returned an invalid status code 'BadRequest'
Solution to Azure: New-AzCdnProfile: Operation returned an invalid status code 'BadRequest'
我正在使用即用即付订阅,我正在使用下面的 Powershell 命令创建 cdn 配置文件。
New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" -Sku "Premium_Verizon" -Location "Uk South" -ErrorAction Stop -Verbose
它 returns 我的错误信息非常少。
New-AzCdnProfile : Operation returned an invalid status code 'BadRequest'
At line:1 char:1
+ New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzCdnProfile], ErrorResponseException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Cdn.Profile.NewAzureRmCdnProfile
在我尝试使用 Powershell 的多个选项后,我试图使用 Azure CLI 执行相同的命令,但出现以下错误。这让我有更多的场景。
az : ERROR: (LocationNotAvailableForResourceType) The provided location 'uksouth' is not available for resource type 'Microsoft.Cdn/profiles'. List of available regions for the resource type is 'global,australiaeast,australiasouth
east,brazilsouth,canadacentral,canadaeast,centralindia,centralus,eastasia,eastus,eastus2,japaneast,japanwest,northcentralus,northeurope,southcentralus,southindia,southeastasia,westeurope,westindia,westus,westcentralus'.
At line:1 char:1
- az cdn 配置文件创建 --name cdnprofiledelHub --resource-group "HUB" ...
-
+ CategoryInfo : NotSpecified: (ERROR: (Locatio...westcentralus'.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
然后我试试这个 Powershell 命令
解决方案:-
New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" -Sku "Premium_Verizon" -Location Global -ErrorAction Stop -Verbose
结论
您只需要使用 'Microsoft.Cdn' 提供商支持的那些区域。截至目前(12/10/2021)Microsoft 仅支持以下区域。以下区域或位置将发生变化。
- 全球,
- 澳大利亚东部,
- 澳大利亚东南部,
- 巴西南部,
- 加拿大中央,
- 加拿大东部,
- 中印度,
- 中央,
- 东亚,
- 伊斯特斯,
- eastus2,
- 东日本,
- 日本西部,
- 中北,
- 北欧,
- 中南,
- 南印度,
- 东南亚,
- 西欧,
- 西印度群岛,
- 韦斯特斯,
- 中西部
我正在使用即用即付订阅,我正在使用下面的 Powershell 命令创建 cdn 配置文件。
New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" -Sku "Premium_Verizon" -Location "Uk South" -ErrorAction Stop -Verbose
它 returns 我的错误信息非常少。
New-AzCdnProfile : Operation returned an invalid status code 'BadRequest' At line:1 char:1 + New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzCdnProfile], ErrorResponseException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Cdn.Profile.NewAzureRmCdnProfile
在我尝试使用 Powershell 的多个选项后,我试图使用 Azure CLI 执行相同的命令,但出现以下错误。这让我有更多的场景。
az : ERROR: (LocationNotAvailableForResourceType) The provided location 'uksouth' is not available for resource type 'Microsoft.Cdn/profiles'. List of available regions for the resource type is 'global,australiaeast,australiasouth east,brazilsouth,canadacentral,canadaeast,centralindia,centralus,eastasia,eastus,eastus2,japaneast,japanwest,northcentralus,northeurope,southcentralus,southindia,southeastasia,westeurope,westindia,westus,westcentralus'. At line:1 char:1
- az cdn 配置文件创建 --name cdnprofiledelHub --resource-group "HUB" ...
-
+ CategoryInfo : NotSpecified: (ERROR: (Locatio...westcentralus'.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
然后我试试这个 Powershell 命令
解决方案:-
New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" -Sku "Premium_Verizon" -Location Global -ErrorAction Stop -Verbose
结论 您只需要使用 'Microsoft.Cdn' 提供商支持的那些区域。截至目前(12/10/2021)Microsoft 仅支持以下区域。以下区域或位置将发生变化。
- 全球,
- 澳大利亚东部,
- 澳大利亚东南部,
- 巴西南部,
- 加拿大中央,
- 加拿大东部,
- 中印度,
- 中央,
- 东亚,
- 伊斯特斯,
- eastus2,
- 东日本,
- 日本西部,
- 中北,
- 北欧,
- 中南,
- 南印度,
- 东南亚,
- 西欧,
- 西印度群岛,
- 韦斯特斯,
- 中西部