我使用的是现收现付订阅,我使用下面的Powershell命令来创建cdn配置文件。
New-AzCdnProfile -ProfileName "cdnprofileforcache" -ResourceGroupName "rg-cdn" -Sku "Premium_Verizon" -Location "Uk South" -ErrorAction Stop -Verbose
它返回给我非常少的信息作为错误。
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)提供的位置'uksouth'对于资源类型'Microsoft.Cdn/profiles'不可用。资源类型的可用区域列表是"global,australiaeast, australiassouth"东,brazilsouth、canadacentral canadaeast centralindia, centralus, eastasia, eastus, eastus2, japaneast, japanwest, northcentralus, northeurope, southcentralus, southindia, southeastasia, westeurope, westindia, westus, westcentralus’。
- az cdnprofile create——name cdnprofiledelHub——resource-group "…
+ 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),微软只支持以下地区。以下区域或位置将会更改
全球,- australiaeast,
- australiasouth东部,
- brazilsouth,
- canadacentral,
- canadaeast,
- centralindia,
- centralus,
- eastasia,
- eastus,
- eastus2,
- japaneast,
- japanwest,
- northcentralus,
- northeurope,
- southcentralus,
- southindia,
- southeastasia,
- westeurope,
- westindia,
- westus,
- westcentralus