你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Az 8.0.0 迁移指南

Az.Aks

Get-AzAks

Get-AzAks 别名已删除。 请改用 Get-AzAksCluster

之前

Get-AzAks -ResourceGroupName $resourceGroupName -Name $name

之后

Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $name

New-AzAks

New-AzAks 别名已删除。 请改用 New-AzAksCluster

之前

New-AzAks -ResourceGroupName $resourceGroupName -Name $name -Location $location

之后

New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $name -Location $location

Set-AzAks

Set-AzAks 别名已删除。 请改用 Set-AzAksCluster

之前

Set-AzAks -ResourceGroupName $resourceGroupName -Name $name

之后

Set-AzAksCluster -ResourceGroupName $resourceGroupName -Name $name

Remove-AzAks

Remove-AzAks 别名已删除。 请改用 Remove-AzAksCluster

之前

Remove-AzAks -ResourceGroupName $resourceGroupName -Name $name

之后

Remove-AzAksCluster -ResourceGroupName $resourceGroupName -Name $name

Az.Cdn

New-AzCdnProfile

将参数 Sku 的类型更改为了 SkuName 将参数 ProfileName 的类型更改为了 Name

之前

$profileSku = "Standard_Microsoft";
$cdnProfileName = "profileNameXXXX";
$resourceGroupName = "myresourcegroup"
New-AzCdnProfile -Sku $profileSku -ProfileName $cdnProfileName -ResourceGroupName $resourceGroupName -Location Global

之后

$profileSku = "Standard_Microsoft";
$cdnProfileName = "profileNameXXXX";
$resourceGroupName = "myresourcegroup"
New-AzCdnProfile -SkuName $profileSku -Name $cdnProfileName -ResourceGroupName $resourceGroupName -Location Global

New-AzCdnEndpoint

将参数 EndpointName 更改为了 Name 将参数 GeoFilters 更改为了 GeoFilter 将参数 DefaultOriginGroup 更改为了 DefaultOriginGroupId 将参数 OriginHostNameOriginIdOriginNamePriorityPrivateLinkApprovalMessagePrivateLinkLocationPrivateLinkResourceIdWeightHttpPort,HttpsPort 合并为参数 Origin 将参数 OriginGroupNameOriginGroupProbeIntervalInSecondsOriginGroupProbePathOriginGroupProbeProtocolOriginGroupProbeRequestType 合并为参数 OriginGroup 将参数 DeliveryPolicy 拆分为参数 DeliveryPolicyDescriptionDeliveryPolicyRule 添加参数 SubscriptionIdUrlSigningKeyWebApplicationFirewallPolicyLinkId 删除参数 CdnProfile

之前

New-AzCdnEndpoint -ResourceGroupName myresourcegroup -ProfileName mycdnprofile -Location westus -EndpointName myendpoint `
                  -OriginName mystorage -OriginHostName mystorage.blob.core.windows.net `
                  -OriginHostHeader mystorage.blob.core.windows.net -IsHttpAllowed $false

之后

$origin = @{
  Name = "origin1"
  HostName = "host1.hello.com"
};
$location = "westus"

$endpoint = New-AzCdnEndpoint -Name $endpointName -ResourceGroupName $ResourceGroupName -ProfileName $cdnProfileName -Location $location -Origin $origin

New-AzCdnDeliveryPolicy

删除命令 New-AzCdnDeliveryPolicy。 使用 New-AzCdnDeliveryRuleObject 创建规则对象并直接在 New-AzCdnEndpoint 中使用

New-AzCdnDeliveryRule

将命令名称更改为了 New-AzCdnDeliveryRuleObject

之前

New-AzCdnDeliveryRule -Name "rule1" -Order 1 -Condition $cond1 -Action $action1

之后

$cond1 = New-AzCdnDeliveryRuleIsDeviceConditionObject -Name "IsDevice" -ParameterMatchValue "Desktop"
$action1 = New-AzCdnUrlRewriteActionObject -Name "UrlRewrite" -ParameterDestination "/def" -ParameterSourcePattern "/abc" -ParameterPreserveUnmatchedPath $true
$rule1 = New-AzCdnDeliveryRuleObject -Name "Rule1" -Action $action1,$action2 -Condition $cond1 -Order 1

New-AzCdnCustomDomain

将参数 CustomDomainName 的类型更改为了 Name 添加参数 SubscriptionId 删除参数 CdnEndpoint

之前

New-AzCdnCustomDomain -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName -CustomDomainName $customDomainName -HostName $customDomainHostName

之后

New-AzCdnCustomDomain -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName -Name $customDomainName -HostName $customDomainHostName -SubscriptionId $subId

Set-AzCdnProfile

替换为了命令 Update-AzCdnProfile

之前

$profileObject = Get-AzCdnProfile -ResourceGroupName myresourcegroup -ProfileName mycdnprofile
$profileObject.Tags = @{"key"="value"}
Set-AzCdnProfile -CdnProfile $profileObject

调整后的文本

$profileSku = "Standard_Microsoft";
$cdnProfileName = "profileNameXXXX";
$resourceGroupName = "myresourcegroup"
New-AzCdnProfile -SkuName $profileSku -Name $cdnProfileName -ResourceGroupName $resourceGroupName -Location Global

$tags = @{
  Tag1 = 11
  Tag2  = 22
}
Update-AzCdnProfile -Name $cdnProfileName -ResourceGroupName $resourceGroupName -Tag $tags

Set-AzCdnEndpoint

替换为了命令 Update-AzCdnEndpointDeliveryPolicyDescription要更新 和 DeliveryPolicyRule 中之一时,应同时提供两者。

之前

$endpointObject = Get-AzCdnEndpoint -ResourceGroupName myresourcegroup -ProfileName mycdnprofile -EndpointName myendpoint
$endpointObject.IsHttpAllowed = $false
Set-AzCdnEndpoint -CdnEndpoint $endpointObject

之后

$tags = @{
  Tag1 = 11
  Tag2  = 22
}

//Update tags
Update-AzCdnEndpoint -Name $endpointName -ProfileName $cdnProfileName -ResourceGroupName $resourceGroupName -Tag $tags

//Update DeliveryPolicyDescription or DeliveryPolicyRule
Update-AzCdnEndpoint -Name $endpointName -ProfileName $cdnProfileName -ResourceGroupName $resourceGroupName `
   -DeliveryPolicyDescription $descprption -DeliveryPolicyRule $rule

Set-AzCdnOriginGroup

替换为了命令 Update-AzCdnOriginGroup

之前

Set-AzCdnOriginGroup -ResourceGroupName $resourceGroupName -ProfileName $profileName -EndpointName $endpointName -OriginGroupName $originGroupName -OriginId $originIds -ProbeIntervalInSeconds $probeInterval

之后

Update-AzCdnOriginGroup -EndpointName $endpointName -Name $originGroup.Name -ProfileName $cdnProfileName -ResourceGroupName $ResourceGroupName `
                -HealthProbeSetting $healthProbeParametersObject2 -Origin @(@{ Id = $originId })

Set-AzCdnOrigin

替换为了命令 Update-AzCdnOrigin

之前

Set-AzCdnOrigin -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName `
    -OriginName $originName -HostName "mystorage2.blob.core.windows.net"

之后

Update-AzCdnOrigin -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName `
    -Name $originName  -HostName "mystorage2.blob.core.windows.net" -HttpPort 456 -HttpsPort 789

Unpublish-AzCdnEndpointContent

替换为了命令 Clear-AzCdnEndpointContent

之前

Unpublish-AzCdnEndpointContent -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName `
   -PurgeContent $PurgeContent   

之后

Clear-AzCdnEndpointContent -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName `
   -ContentPath $PurgeContent   

Publish-AzCdnEndpointContent

替换为了命令 Import-AzCdnEndpointContent

之前

Publish-AzCdnEndpointContent -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName `
   -LoadContent $LoadContent

之后

Import-AzCdnEndpointContent -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -EndpointName $endpointName `
   -ContentPath $LoadContent

Az.EventHub

New-AzEventHubNamespace

参数 Identity 已删除。

之前

New-AzEventHubNamespace -ResourceGroupName myresourcegroup -Name MyNamespaceName -Location northeurope -SkuName Premium -IdentityType SystemAssigned -Identity

之后

New-AzEventHubNamespace -ResourceGroupName myresourcegroup -Name MyNamespaceName -Location northeurope -SkuName Premium -IdentityType SystemAssigned

Set-AzEventHubNamespace

参数 Identity 已删除。

之前

Set-AzEventHubNamespace -ResourceGroupName myresourcegroup -Name MyNamespaceName -EncryptionConfig $ec1,$ec2 -Identity

之后

Set-AzEventHubNamespace -ResourceGroupName myresourcegroup -Name MyNamespaceName -EncryptionConfig $ec1,$ec2

Az.HealthcareApis

Set-AzHealthcareApisService

将 New-AzHealthcareApisService 和 Set-AzHealthcareApisService 合并为 New-AzHealthcareApisService

之前

Set-AzHealthcareApisService -Name MyService -ResourceGroupName MyResourceGroup -CosmosOfferThroughput 500

之后

New-AzHealthcareApisService -Name MyService -ResourceGroupName MyResourceGroup -Location MyLocation -Kind fhir-R4 -CosmosOfferThroughput 500

Get-AzHealthcareApisService

-ResourceId 已删除

之前

Get-AzHealthcareApisService -ResourceId $ResourceId

之后

Get-AzHealthcareApisService -ResourceGroupName $ResourceGroup -Name $Name

Remove-AzHealthcareApisService

-ResourceId 已删除

之前

Remove-AzHealthcareApisService -ResourceId $ResourceId

调整后的文本

Remove-AzHealthcareApisService -ResourceGroupName $ResourceGroup -Name $Name

New-AzHealthcareApisService

-ManagedIdentity 重命名为了 -IdentityType;删除了 -FhirVersion,现在可以通过参数 -Kind 选择所需的内容;-DisableCorsCredential-AllowCorsCredential 现在统一命名为了 -AllowCorsCredential,例如 -AllowCorsCredential:$false 或 -AllowCorsCredential:$true;-DisableSmartProxy-EnableSmartProxy 现在统一命名为了 -EnableSmartProxy,例如 -EnableSmartProxy:$false 或 -EnableSmartProxy:$true

之前

New-AzHealthcareApisService -Name MyService -ResourceGroupName MyResourceGroup -Location MyLocation -FhirVersion fhir-R4 -CosmosOfferThroughput 500 -ManagedIdentity $IdentityType -DisableCorsCredential -DisableSmartProxy

之后

New-AzHealthcareApisService -Name MyService -ResourceGroupName MyResourceGroup -Location MyLocation -Kind fhir-R4 -CosmosOfferThroughput 500 -IdentityType $IdentityType -AllowCorsCredential:$false -EnableSmartProxy:$false