你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Az 3.0.0 迁移指南
本文档介绍 Az 2.0.0 和 3.0.0 版本之间的更改
- Az 3.0.0 迁移指南
- Batch
- Compute
- HDInsight
- IotHub
- RecoveryServices
- Resources
- 与以前版本的
Az.Batch
不兼容
- 与以前版本的
- ServiceFabric
- Sql
Get-AzSqlDatabaseSecureConnectionPolicy
Get-AzSqlDatabaseIndexRecommendations
Get-AzSqlDatabaseRestorePoints
Get-AzSqlDatabaseAuditing
Set-AzSqlDatabaseAuditing
Get-AzSqlServerAuditing
Set-AzSqlServerAuditing
Get-AzSqlServerAdvancedThreatProtectionSettings
Clear-AzSqlServerAdvancedThreatProtectionSettings
Update-AzSqlServerAdvancedThreatProtectionSettings
Get-AzSqlDatabaseAdvancedThreatProtectionSettings
Update-AzSqlDatabaseAdvancedThreatProtectionSettings
Clear-AzSqlDatabaseAdvancedThreatProtectionSettings
Update-AzSqlDatabaseVulnerabilityAssessmentSettings
Get-AzSqlDatabaseVulnerabilityAssessmentSettings
Clear-AzSqlDatabaseVulnerabilityAssessmentSettings
Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings
Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings
Clear-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings
Update-AzSqlInstanceVulnerabilityAssessmentSettings
Get-AzSqlInstanceVulnerabilityAssessmentSettings
Clear-AzSqlInstanceVulnerabilityAssessmentSettings
Update-AzSqlServerVulnerabilityAssessmentSettings
Get-AzSqlServerVulnerabilityAssessmentSettings
Clear-AzSqlServerVulnerabilityAssessmentSettings
Get-AzSqlServerAdvancedThreatProtectionPolicy
Get-AzSqlServerThreatDetectionPolicy
Remove-AzSqlServerThreatDetectionPolicy
Set-AzSqlServerThreatDetectionPolicy
Get-AzSqlDatabaseThreatDetectionPolicy
Set-AzSqlDatabaseThreatDetectionPolicy
Remove-AzSqlDatabaseThreatDetectionPolicy
Batch
Get-AzBatchNodeAgentSku
- 删除
Get-AzBatchNodeAgentSku
并将其替换为Get-AzBatchSupportedImage
。 Get-AzBatchSupportedImage
返回与Get-AzBatchNodeAgentSku
相同的数据,但采用更友好的格式。- 现在也返回新的未验证的图像。 此文还包括每个图像的
Capabilities
和BatchSupportEndOfLife
的其他信息。
之前
$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 或更低版本)不兼容。 导入“Az.Batch”模块版本 2.0.1 时,这将导致无法导入“Az.Resources”模块的版本 1.7.0。 若要解决此问题,只需将“Az.Resources”模块更新为版本 1.7.1 或更高版本,或只是安装最新版本的“Az”模块。
Compute
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-AzHDInsightOperationsManagementSuite
和 Disable-AzHDInsightOMS
)。
之前
Disable-AzHDInsightOMS -Name testcluster
Disable-AzHDInsightOperationsManagementSuite -Name testcluster
之后
Disable-AzHDInsightMonitoring -Name testcluster
Enable-AzHDInsightMonitoring
添加了新的 Enable-AzHDInsightMonitoring
Cmdlet。 使用此 cmdlet 在 HDInsight 群集中启用监视(替换 Enable-AzHDInsightOperationsManagementSuite
和 Enable-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-AzHDInsightOperationsManagementSuite
和 Get-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-AzHDInsightRdpServicesAccess
和 Revoke-AzHDInsightRdpServicesAccess
cmdlet。 由于不支持使用 Windows OS 类型的群集,因此不再需要这些群集。 请改用 Linux OS 类型创建群集。
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 仅附带一个内置终结点(“events”),它可以处理系统和设备消息。
之前
Add-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName "myconsumergroup" -EventHubEndpointName "/EventHubEndpointName"
之后
Add-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName "myconsumergroup"
Get-AzIotHubEventHubConsumerGroup
参数 EventHubEndPointName
已弃用,而不会被替换,因为 IotHub 仅附带一个内置终结点(“events”),它可以处理系统和设备消息。
之前
Get-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubEndpointName "/EventHubEndpointName"
之后
Get-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub"
Remove-AzIotHubEventHubConsumerGroup
参数 EventHubEndPointName
已弃用,而不会被替换,因为 IotHub 仅附带一个内置终结点(“events”),它可以处理系统和设备消息。
之前
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.ReplicationProtectedItems
、ASRRecoveryPlanGroup.StartGroupActions
和 ASRRecoveryPlanGroup.EndGroupActions
。
Get-AzRecoveryServicesAsrRecoveryPlan
从输出中删除 ASRRecoveryPlanGroup.ReplicationProtectedItems
、ASRRecoveryPlanGroup.StartGroupActions
和 ASRRecoveryPlanGroup.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 或更低版本)不兼容。 导入“Az.Resources”模块版本 1.7.1 时,这将导致无法导入“Az.Batch”模块的版本 1.1.2。 若要解决此问题,请将“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”,并删除属性
AuditState
、StorageAccountName
以及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”。 删除属性
AuditState
、StorageAccountName
和StorageAccountSubscriptionId
。 使用StorageAccountName
和StorageAccountSubscriptionId
代理的脚本可以从新的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"