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

Az 3.0.0 迁移指南

本文档介绍了 Az 版本 2.0.0 和 3.0.0 之间的变更

Batch

Get-AzBatchNodeAgentSku

  • 删除了 Get-AzBatchNodeAgentSku 并将其替换为 Get-AzBatchSupportedImage
  • Get-AzBatchSupportedImage 以更友好的格式返回与 Get-AzBatchNodeAgentSku 相同的数据。
  • 现在也返回新的未验证的图像。 此文还包括每个图像的 CapabilitiesBatchSupportEndOfLife 的其他信息。

以前

$Context = Get-AzBatchAccountKeys -AccountName "ContosoBatchAccount"
Get-AzBatchNodeAgentSku -BatchContext $Context

之后

$Context = Get-AzBatchAccountKey -AccountName "ContosoBatchAccount"
Get-AzBatchSupportedImage -BatchContext $Context

以前的版本与 Az.Resources 模块的不兼容

“Az.Batch”模块的 2.0.1 版与“Az.Resources”模块的早期版本(版本 1.7.0 或更早版本)不兼容。 这将导致在已导入 2.0.1 版“Az.Batch”模块时无法导入 1.7.0 版“Az.Resources”模块。 若要解决此问题,只需将“Az.Resources”模块更新到版本 1.7.1 或更高版本,或者直接安装最新版本的“Az”模块。

计算

New-AzDiskConfig

在 CreateOption 为 Upload 时,将为 New-AzDiskConfig 使用 UploadSizeInBytes 参数而不是 DiskSizeGB

以前

$diskconfig = New-AzDiskConfig -Location 'Central US' -DiskSizeGB 1023 -SkuName Standard_LRS -OsType Windows -CreateOption Upload -DiskIOPSReadWrite 500 -DiskMBpsReadWrite 8

之后

$diskconfig = New-AzDiskConfig -Location 'Central US' -UploadSizeInBytes 1023 * 1024 * 1024 * 1024 -SkuName Standard_LRS -OsType Windows -CreateOption Upload -DiskIOPSReadWrite 500 -DiskMBpsReadWrite 8

HDInsight

Get-AzHDInsightJobOutput

  • 更新了 Get-AzHDInsightJobOutput cmdlet,支持对存储密钥进行细化的基于角色的访问。
  • 具有 HDInsight 群集的“操作员”、“参与者”或“所有者”角色的用户将不受影响。
  • 只具有“读者”角色的用户将需要显式指定 DefaultStorageAccountKey 参数。

以前

Get-AzHDInsightJobOutput  -ClusterName $clusterName -JobId $jobId

之后

Get-AzHDInsightJobOutput -ClusterName $clusterName -JobId $jobId -DefaultStorageAccountKey $storageAccountKey

Add-AzHDInsightConfigValues

Cmdlet Add-AzHDInsightConfigValue 删除了 Add-AzHDInsightConfigValues 的别名。

以前

使用弃用的别名

Add-AzHDInsightConfigValues

之后

Add-AzHDInsightConfigValue

Disable-AzHDInsightMonitoring

添加了新的 Disable-AzHDInsightMonitoring Cmdlet。 使用此 Cmdlet 可在 HDInsight 群集中禁用监视(替换 Disable-AzHDInsightOperationsManagementSuiteDisable-AzHDInsightOMS)。

以前

Disable-AzHDInsightOMS -Name testcluster
Disable-AzHDInsightOperationsManagementSuite -Name testcluster

之后

Disable-AzHDInsightMonitoring -Name testcluster

Enable-AzHDInsightMonitoring

添加了新的 Enable-AzHDInsightMonitoring Cmdlet。 使用此 Cmdlet 可在 HDInsight 群集中启用监视(替换 Enable-AzHDInsightOperationsManagementSuiteEnable-AzHDInsightOMS)。

以前

Enable-AzHDInsightOMS Enable-AzHDInsightMonitoring -Name testcluster -WorkspaceId 1d364e89-bb71-4503-aa3d-a23535aea7bd -PrimaryKey <key for workspace 1d364e89-bb71-4503-aa3d-a23535aea7bd>
Enable-AzHDInsightOperationsManagementSuite Enable-AzHDInsightMonitoring -Name testcluster -WorkspaceId 1d364e89-bb71-4503-aa3d-a23535aea7bd -PrimaryKey <key for workspace 1d364e89-bb71-4503-aa3d-a23535aea7bd>

之后

Enable-AzHDInsightMonitoring Enable-AzHDInsightMonitoring -Name testcluster -WorkspaceId 1d364e89-bb71-4503-aa3d-a23535aea7bd -PrimaryKey <key for workspace 1d364e89-bb71-4503-aa3d-a23535aea7bd>

Get-AzHDInsightMonitoring

添加了新的 Get-AzHDInsightMonitoring Cmdlet。 使用此 Cmdlet 可获取 Azure HDInsight 群集中监视安装的状态(替换 Get-AzHDInsightOperationsManagementSuiteGet-AzHDInsightOMS)。

以前

Get-AzHDInsightOMS -Name testcluster
Get-AzHDInsightOperationsManagementSuite -Name testcluster

之后

Get-AzHDInsightMonitoring -Name testcluster

Get-AzHDInsightProperty

Cmdlet Get-HDInsightProperty 删除了 Get-AzHDInsightProperties 的别名。

以前

使用弃用的别名

Get-AzHDInsightProperties -Location "East US 2"

之后

Get-AzHDInsightProperty -Location "East US 2"

Grant-AzHDInsightRdpServicesAccess

删除了 Grant-AzHDInsightRdpServicesAccessRevoke-AzHDInsightRdpServicesAccess cmdlet。 这些不再是必需的,因为使用 Windows 操作系统类型的群集不受支持。 请改为创建 Linux 操作系统类型的群集。

Remove-AzHDInsightCluster

Remove-AzHDInsightCluster 的输出类型已从 Microsoft.Azure.Management.HDInsight.Models.ClusterGetResponse 更改为 bool

以前

$cluster = Remove-AzHDInsightCluster -ClusterName "your-hadoop-001"

之后

Remove-AzHDInsightCluster -ClusterName "your-hadoop-001" -PassThru
True

Revoke-AzHDInsightRdpServicesAccess

该 Cmdlet 已弃用。 它没有任何替换。

Set-AzHDInsightGatewayCredential

Set-AzHDInsightGatewayCredential 的输出类型已从 HttpConnectivitySettings 更改为 AzureHDInsightGatewaySettings

IotHub

New-AzIotHubImportDevices

此别名已删除,请改用 New-AzIotHubImportDevice

以前

New-AzIotHubImportDevices -ResourceGroupName "myresourcegroup" -Name "myiothub" -InputBlobContainerUri "https://mystorageaccount.blob.core.windows.net/mystoragecontainer?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" -OutputBlobContainerUri "https://mystorageaccount.blob.core.windows.net/?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D"

之后

New-AzIotHubImportDevice -ResourceGroupName "myresourcegroup" -Name "myiothub" -InputBlobContainerUri "https://mystorageaccount.blob.core.windows.net/mystoragecontainer?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" -OutputBlobContainerUri "https://mystorageaccount.blob.core.windows.net/?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D"

New-AzIotHubExportDevices

此别名已删除,请改用 New-AzIotHubExportDevice

以前

New-AzIotHubExportDevices -ResourceGroupName "myresourcegroup" -Name "myiothub" -ExportBlobContainerUri "https://mystorageaccount.blob.core.windows.net/mystoragecontainer?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" -ExcludeKeys

之后

New-AzIotHubExportDevice -ResourceGroupName "myresourcegroup" -Name "myiothub" -ExportBlobContainerUri "https://mystorageaccount.blob.core.windows.net/mystoragecontainer?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" -ExcludeKeys

Add-AzIotHubEventHubConsumerGroup

参数 EventHubEndPointName 已弃用而未进行替换,因为 IotHub 附带了一个可以处理系统和设备消息的内置终结点(“事件”)。

以前

Add-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName "myconsumergroup" -EventHubEndpointName "/EventHubEndpointName"

之后

Add-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName "myconsumergroup"

Get-AzIotHubEventHubConsumerGroup

参数 EventHubEndPointName 已弃用而未进行替换,因为 IotHub 附带了一个可以处理系统和设备消息的内置终结点(“事件”)。

以前

Get-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubEndpointName "/EventHubEndpointName"

之后

Get-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub"

Remove-AzIotHubEventHubConsumerGroup

参数 EventHubEndPointName 已弃用而未进行替换,因为 IotHub 附带了一个可以处理系统和设备消息的内置终结点(“事件”)。

以前

Remove-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName myconsumergroup -EventHubEndpointName "/EventHubEndpointName"

之后

Remove-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName myconsumergroup

Set-AzIotHub

参数 OperationsMonitoringProperties 已弃用而未进行替换,因为 IotHub 不再使用内置终结点(“operationsMonitoringEvents”)。

RecoveryServices

Edit-AzRecoveryServicesAsrRecoveryPlan

ASRRecoveryPlanGroup.ReplicationProtectedItemsASRRecoveryPlanGroup.StartGroupActionsASRRecoveryPlanGroup.EndGroupActions 已从输出中删除。

Get-AzRecoveryServicesAsrRecoveryPlan

ASRRecoveryPlanGroup.ReplicationProtectedItemsASRRecoveryPlanGroup.StartGroupActionsASRRecoveryPlanGroup.EndGroupActions 已从输出中删除。

New-AzRecoveryServicesAsrReplicationProtectedItem

参数 IncludeDiskId 已更改为支持直接写入到 Azure Site Recovery 中的托管磁盘。

以前

$job = New-AzRecoveryServicesAsrReplicationProtectedItem -RecoveryAzureStorageAccountId $recoveryAzureStorageAccountId -IncludeDiskId $includeDiskId -VMwareToAzure -Account $fabric.FabricSpecificDetails.RunAsAccounts[0] -RecoveryResourceGroupId $RecoveryResourceGroupId -RecoveryAzureNetworkId $RecoveryAzureNetworkId -name $name -ProcessServer $fabric.FabricSpecificDetails.ProcessServers[0] -ProtectableItem $protectableItem -ProtectionContainerMapping $pcm -RecoveryAzureSubnetName $RecoveryAzureSubnetName -RecoveryVmName $RecoveryVmName -LogStorageAccountId $LogStorageAccountId

之后

$disk1 = New-AzRecoveryServicesAsrInMageAzureV2DiskInput -DiskId $diskId -LogStorageAccountId $logStorageAccountId -DiskType $diskType
$disk2 = New-AzRecoveryServicesAsrInMageAzureV2DiskInput -DiskId $diskId2 -LogStorageAccountId $logStorageAccountId -DiskType $diskType2
$job = New-AzRecoveryServicesAsrReplicationProtectedItem -VMwareToAzure -Account $fabric.FabricSpecificDetails.RunAsAccounts[0] -RecoveryResourceGroupId $RecoveryResourceGroupId -RecoveryAzureNetworkId $RecoveryAzureNetworkId -name $name -ProcessServer $fabric.FabricSpecificDetails.ProcessServers[0] -ProtectableItem $protectableItem -ProtectionContainerMapping $pcm -RecoveryAzureSubnetName $RecoveryAzureSubnetName -RecoveryVmName $RecoveryVmName -LogStorageAccountId $LogStorageAccountId -InMageAzureV2DiskInput $disk1,$disk2

资源

以前的版本与 Az.Batch 模块的不兼容

“Az.Resources”模块的 1.7.1 版与“Az.Batch”模块的早期版本(版本 1.1.2 或更早版本)不兼容。 这将导致在已导入 1.7.1 版“Az.Resources”模块时无法导入 1.1.2 版“Az.Batch”模块。 若要解决此问题,请将“Az.Batch”模块更新到版本 2.0.1 或更高版本,或者直接安装最新版本的“Az”模块。

ServiceFabric

Add-ServiceFabricApplicationCertificate

删除了 Add-ServiceFabricApplicationCertificate,因为 Add-AzVmssSecret 已涵盖此方案。

以前

Add-AzServiceFabricApplicationCertificate -ResourceGroupName "Group1" -Name "Contoso01SFCluster" -SecretIdentifier "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion"

之后

$Vault = Get-AzKeyVault -VaultName "ContosoVault"
$CertConfig = New-AzVmssVaultCertificateConfig -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" -CertificateStore "Certificates"
$VMSS = New-AzVmssConfig
Add-AzVmssSecret -VirtualMachineScaleSet $VMSS -SourceVaultId $Vault.ResourceId -VaultCertificate $CertConfig

Sql

Get-AzSqlDatabaseSecureConnectionPolicy

请注意,安全连接已弃用,因此该命令已删除。 请使用 Azure 门户中的“SQL 数据库”边栏选项卡查看连接字符串

Get-AzSqlDatabaseIndexRecommendations

Get-AzSqlDatabaseIndexRecommendations 别名已删除。 请改用 Get-AzSqlDatabaseIndexRecommendation

Get-AzSqlDatabaseRestorePoints

Get-AzSqlDatabaseRestorePoints 别名已删除。 请改用 Get-AzSqlDatabaseRestorePoint

Get-AzSqlDatabaseAuditing

  • Cmdlet Get-AzSqlDatabaseAudit 将替换此 Cmdlet。
  • 输出类型将从现有的类型“Microsoft.Azure.Commands.Sql.Auditing.Model.DatabaseBlobAuditingSettingsModel”更改为新类型“Microsoft.Azure.Commands.Sql.Auditing.Model.DatabaseAuditingSettingsModel”,并删除属性 AuditStateStorageAccountName 以及 StorageAccountSubscriptionId。 脚本可以从新的 StorageAccountResourceId 属性中检索存储帐户信息。

以前

PS C:\> Get-AzSqlDatabaseAuditing -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01"
DatabaseName                 : database01
AuditAction                  : {}
AuditActionGroup             : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP,
                                BATCH_COMPLETED_GROUP, ...}
ResourceGroupName            : resourcegroup01
ServerName                   : server01
AuditState                   : Enabled
StorageAccountName           : mystorage
StorageKeyType               : Primary
RetentionInDays              : 0
StorageAccountSubscriptionId : 7fe3301d-31d3-4668-af5e-211a890ba6e3
PredicateExpression          : statement <> 'select 1'

之后

PS C:\> Get-AzSqlDatabaseAudit -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01"
ServerName                          : server01
DatabaseName                        : database01
AuditAction                         : {}
ResourceGroupName                   : resourcegroup01
AuditActionGroup                    : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP,
                                       BATCH_COMPLETED_GROUP, ...}
PredicateExpression                 : statement <> 'select 1'
BlobStorageTargetState              : Enabled
StorageAccountResourceId            : /subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage
StorageKeyType                      : Primary
RetentionInDays                     : 0
EventHubTargetState                 : Enabled
EventHubName                        : eventHubName
EventHubAuthorizationRuleResourceId : EventHubAuthorizationRuleResourceId
LogAnalyticsTargetState             : Enabled
WorkspaceResourceId                 : "/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2"

Set-AzSqlDatabaseAuditing

  • Cmdlet Set-AzSqlDatabaseAudit 将替换此 Cmdlet。
  • 输出类型将从现有的类型“Microsoft.Azure.Commands.Sql.Auditing.Model.DatabaseBlobAuditingSettingsModel”更改为新的类型“bool”

以前

Set-AzSqlDatabaseAuditing -State Enabled -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -StorageAccountName "Storage22" -DatabaseName "Database01"

之后

Set-AzSqlDatabaseAudit -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" -BlobStorageTargetState Enabled -StorageAccountResourceId "/subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage"

Get-AzSqlServerAuditing

  • Cmdlet Get-AzSqlServerAudit 将替换此 Cmdlet。
  • 输出类型将从现有的类型“Microsoft.Azure.Commands.Sql.Auditing.Model.DatabaseBlobAuditingSettingsModel”更改为新类型“Microsoft.Azure.Commands.Sql.Auditing.Model.ServerAuditingSettingsModel”。 属性 AuditStateStorageAccountNameStorageAccountSubscriptionId 已删除。 使用 StorageAccountNameStorageAccountSubscriptionId 属性的脚本可以从新的 StorageAccountResourceId 属性检索此信息。

以前

PS C:\> Get-AzSqlServerAuditing -ResourceGroupName "resourcegroup01" -ServerName "server01"
AuditActionGroup             : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP, BATCH_COMPLETED_GROUP, ...}
ResourceGroupName            : resourcegroup01
ServerName                   : server01
AuditState                   : Enabled
StorageAccountName           : mystorage
StorageKeyType               : Primary
RetentionInDays              : 0
StorageAccountSubscriptionId : 7fe3301d-31d3-4668-af5e-211a890ba6e3
PredicateExpression          : statement <> 'select 1'

之后

PS C:\> Get-AzSqlServerAudit -ResourceGroupName "resourcegroup01" -ServerName "server01"
ServerName                          : server01
ResourceGroupName                   : resourcegroup01
AuditActionGroup                    : {SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP, BATCH_COMPLETED_GROUP, ...}
PredicateExpression                 : statement <> 'select 1'
BlobStorageTargetState              : Enabled
StorageAccountResourceId            : /subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage
StorageKeyType                      : Primary
RetentionInDays                     : 0
EventHubTargetState                 : Enabled
EventHubName                        : eventHubName
EventHubAuthorizationRuleResourceId : EventHubAuthorizationRuleResourceId
LogAnalyticsTargetState             : Enabled
WorkspaceResourceId                 : "/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2"

Set-AzSqlServerAuditing

  • Cmdlet Set-AzSqlServerAudit 将替换此 Cmdlet。
  • 输出类型将从现有的类型“Microsoft.Azure.Commands.Sql.Auditing.Model.DatabaseBlobAuditingSettingsModel”更改为新的类型“bool”

以前

Set-AzSqlServerAuditing -State Enabled -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -StorageAccountName "Storage22"

之后

PS C:\> Set-AzSqlServerAudit -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -BlobStorageTargetState Enabled -StorageAccountResourceId "/subscriptions/7fe3301d-31d3-4668-af5e-211a890ba6e3/resourceGroups/resourcegroup01/providers/Microsoft.Storage/storageAccounts/mystorage"

Get-AzSqlServerAdvancedThreatProtectionSettings

Cmdlet Get-AzSqlServerAdvancedThreatProtectionSettings 已替换为 Get-AzSqlServerAdvancedThreatProtectionSetting

以前

Get-AzSqlServerAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01"

之后

Get-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01"

Clear-AzSqlServerAdvancedThreatProtectionSettings

Cmdlet Clear-AzSqlServerAdvancedThreatProtectionSettings 已替换为 Clear-AzSqlServerAdvancedThreatProtectionSetting

以前

Clear-AzSqlServerAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01"

之后

Clear-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01"

Update-AzSqlServerAdvancedThreatProtectionSettings

Cmdlet Update-AzSqlServerAdvancedThreatProtectionSettings 已替换为 Update-AzSqlServerAdvancedThreatProtectionSetting

以前

Update-AzSqlServerAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability","SQL_Injection" -StorageAccountName "mystorageAccount"

之后

Update-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability","SQL_Injection" -StorageAccountName "mystorageAccount"

Get-AzSqlDatabaseAdvancedThreatProtectionSettings

Cmdlet Get-AzSqlDatabaseAdvancedThreatProtectionSettings 已替换为 Get-AzSqlDatabaseAdvancedThreatProtectionSetting

以前

Get-AzSqlDatabaseAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"

之后

Get-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"

Update-AzSqlDatabaseAdvancedThreatProtectionSettings

Cmdlet Update-AzSqlDatabaseAdvancedThreatProtectionSettings 已替换为 Update-AzSqlDatabaseAdvancedThreatProtectionSetting

以前

Update-AzSqlDatabaseAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability", "SQL_Injection" -StorageAccountName "mystorageAccount"

之后

Update-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability", "SQL_Injection" -StorageAccountName "mystorageAccount"

Clear-AzSqlDatabaseAdvancedThreatProtectionSettings

Cmdlet Clear-AzSqlDatabaseAdvancedThreatProtectionSettings 已替换为 Clear-AzSqlDatabaseAdvancedThreatProtectionSetting

以前

Clear-AzSqlDatabaseAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"

之后

Clear-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"

Update-AzSqlDatabaseVulnerabilityAssessmentSettings

Cmdlet Update-AzSqlDatabaseVulnerabilityAssessmentSettings 已替换为 Update-AzSqlDatabaseVulnerabilityAssessmentSetting

以前

Update-AzSqlDatabaseVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01"`
    -ServerName "Server01"`
    -DatabaseName "Database01" `
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

之后

Update-AzSqlDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01"`
    -ServerName "Server01"`
    -DatabaseName "Database01" `
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

Get-AzSqlDatabaseVulnerabilityAssessmentSettings

Cmdlet Get-AzSqlDatabaseVulnerabilityAssessmentSettings 已替换为 Get-AzSqlDatabaseVulnerabilityAssessmentSetting

以前

Get-AzSqlDatabaseVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Get-AzSqlDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Clear-AzSqlDatabaseVulnerabilityAssessmentSettings

Cmdlet Clear-AzSqlDatabaseVulnerabilityAssessmentSettings 已替换为 Clear-AzSqlDatabaseVulnerabilityAssessmentSetting

以前

Clear-AzSqlDatabaseVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Clear-AzSqlDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings

Cmdlet Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings 已替换为 Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting

以前

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -InstanceName "ManagedInstance01" `
    -DatabaseName "Database01" `
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

之后

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -InstanceName "ManagedInstance01" `
    -DatabaseName "Database01" `
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings

Cmdlet Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings 已替换为 Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting

以前

Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Clear-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings

Cmdlet Clear-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings 已替换为 Clear-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting

以前

Clear-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Clear-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Update-AzSqlInstanceVulnerabilityAssessmentSettings

Cmdlet Update-AzSqlInstanceVulnerabilityAssessmentSettings 已替换为 Update-AzSqlInstanceVulnerabilityAssessmentSetting

以前

Update-AzSqlInstanceVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -InstanceName "ManagedInstance01" `
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

之后

Update-AzSqlInstanceVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -InstanceName "ManagedInstance01" `
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

Get-AzSqlInstanceVulnerabilityAssessmentSettings

Cmdlet Get-AzSqlInstanceVulnerabilityAssessmentSettings 已替换为 Get-AzSqlInstanceVulnerabilityAssessmentSetting

以前

Get-AzSqlInstanceVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Get-AzSqlInstanceVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Clear-AzSqlInstanceVulnerabilityAssessmentSettings

Cmdlet Clear-AzSqlInstanceVulnerabilityAssessmentSettings 已替换为 Clear-AzSqlInstanceVulnerabilityAssessmentSetting

以前

Clear-AzSqlInstanceVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Clear-AzSqlInstanceVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Update-AzSqlServerVulnerabilityAssessmentSettings

Cmdlet Update-AzSqlServerVulnerabilityAssessmentSettings 已替换为 Update-AzSqlServerVulnerabilityAssessmentSetting

以前

Update-AzSqlServerVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01"`
    -ServerName "Server01"`
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

之后

Update-AzSqlServerVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01"`
    -ServerName "Server01"`
    -StorageAccountName "mystorage" `
    -ScanResultsContainerName "vulnerability-assessment" `
    -RecurringScansInterval Weekly `
    -EmailSubscriptionAdmins $true `
    -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

Get-AzSqlServerVulnerabilityAssessmentSettings

Cmdlet Get-AzSqlServerVulnerabilityAssessmentSettings 已替换为 Get-AzSqlServerVulnerabilityAssessmentSetting

以前

Get-AzSqlServerVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Get-AzSqlServerVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Clear-AzSqlServerVulnerabilityAssessmentSettings

Cmdlet Clear-AzSqlServerVulnerabilityAssessmentSettings 已替换为 Clear-AzSqlServerVulnerabilityAssessmentSetting

以前

Clear-AzSqlServerVulnerabilityAssessmentSettings `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

之后

Clear-AzSqlDatabaseVulnerabilityAssessmentSetting `
    -ResourceGroupName "ResourceGroup01" `
    -ServerName "Server01" `
    -DatabaseName "Database01"

Get-AzSqlServerAdvancedThreatProtectionPolicy

Cmdlet Get-AzSqlServerAdvancedThreatProtectionPolicy 已删除,并且没有任何 Cmdlet 替换它

Get-AzSqlServerThreatDetectionPolicy

Cmdlet Get-AzSqlServerThreatDetectionPolicy 已替换为 Get-AzSqlServerThreatDetectionSetting

以前

PS C:\> Get-AzSqlServerThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01"
ResourceGroupName            : ResourceGroup11
ServerName                   : Server01
ThreatDetectionState         : Enabled
NotificationRecipientsEmails : admin@myCompany.com
StorageAccountName           : mystorage
EmailAdmins                  : True
ExcludedDetectionTypes       : {}
RetentionInDays              : 0

之后

PS C:\> Get-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01"
ResourceGroupName            : ResourceGroup11
ServerName                   : Server01
ThreatDetectionState         : Enabled
NotificationRecipientsEmails : admin@myCompany.com
StorageAccountName           : mystorage
EmailAdmins                  : True
ExcludedDetectionTypes       : {}
RetentionInDays              : 0

Remove-AzSqlServerThreatDetectionPolicy

Cmdlet Remove-AzSqlServerThreatDetectionPolicy 已替换为 Clear-AzSqlServerAdvancedThreatProtectionSetting

以前

Remove-AzSqlServerThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01"

之后

Clear-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01"

Set-AzSqlServerThreatDetectionPolicy

Cmdlet Set-AzSqlServerThreatDetectionPolicy 已替换为 Update-AzSqlServerAdvancedThreatProtectionSetting

以前

Set-AzSqlServerThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability","SQL_Injection" -StorageAccountName "mystorageAccount"

之后

Update-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability","SQL_Injection" -StorageAccountName "mystorageAccount"

Get-AzSqlDatabaseThreatDetectionPolicy

Cmdlet Get-AzSqlDatabaseThreatDetectionPolicy 已替换为 Get-AzSqlDatabaseThreatDetectionSetting

以前

PS C:\> Get-AzSqlDatabaseThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName   "Database01"
DatabaseName                 : Database01
ResourceGroupName            : ResourceGroup11
ServerName                   : Server01
ThreatDetectionState         : Enabled
NotificationRecipientsEmails : admin@myCompany.com
StorageAccountName           : mystorage
EmailAdmins                  : True
ExcludedDetectionTypes       : {}
RetentionInDays              : 0

之后

PS C:\> Get-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01"   -DatabaseName "Database01"
DatabaseName                 : Database01
ResourceGroupName            : ResourceGroup11
ServerName                   : Server01
ThreatDetectionState         : Enabled
NotificationRecipientsEmails : admin@myCompany.com
StorageAccountName           : mystorage
EmailAdmins                  : True
ExcludedDetectionTypes       : {}
RetentionInDays              : 0

Set-AzSqlDatabaseThreatDetectionPolicy

Cmdlet Set-AzSqlDatabaseThreatDetectionPolicy 已替换为 Update-AzSqlDatabaseAdvancedThreatProtectionSetting

以前

Set-AzSqlDatabaseThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability", "SQL_Injection" -StorageAccountName "mystorageAccount"

之后

Update-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability", "SQL_Injection" -StorageAccountName "mystorageAccount"

Remove-AzSqlDatabaseThreatDetectionPolicy

Cmdlet Remove-AzSqlDatabaseThreatDetectionPolicy 已替换为 Clear-AzSqlDatabaseAdvancedThreatProtectionSetting

以前

Remove-AzSqlDatabaseThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"

之后

Clear-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"