diff --git a/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml b/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml index 01ead1f92cc7..ef4853312d3b 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml +++ b/src/ResourceManager/Sql/Commands.Sql/Microsoft.Azure.Commands.Sql.dll-Help.xml @@ -2211,7 +2211,158 @@ SecureConnectionState : Optional - + + + + Get-AzureRmSqlDatabaseThreatDetectionPolicy + + Gets the threat detection policy for a database. + + + + + Get + AzureRmSqlDatabaseThreatDetectionPolicy + + + + The Get-AzureRmSqlDatabaseThreatDetectionPolicy cmdlet gets the threat detection policy of an Azure SQL database. To use this cmdlet, specify the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database for which this cmdlet gets the policy. + + + + Get-AzureRmSqlDatabaseThreatDetectionPolicy + + ResourceGroupName + + Specifies the name of the resource group that the server is assigned to. + + String + + + ServerName + + Specifies the name of a server. + + String + + + DatabaseName + + Specifies the name of a database. + + String + + + + + + DatabaseName + + Specifies the name of a database. + + String + + String + + + none + + + ResourceGroupName + + Specifies the name of the resource group that the server is assigned to. + + String + + String + + + none + + + ServerName + + Specifies the name of a server. + + String + + String + + + none + + + + + + + + + + + + + You cannot pipe input to this cmdlet. + + + + + + + Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DatabaseThreatDetectionPolicyModel + + + + + + + This cmdlet returns a Model.DatabaseThreatDetectionPolicyModel object. + + + + + + + + Example 1: Get the threat detection policy for a database + + + + PS C:\> Get-AzureRmSqlDatabaseThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" +DatabaseName : Database01 +ResourceGroupName : ResourceGroup11 +ServerName : Server01 +ThreatDetectionState : Disabled +NotificationRecipientsEmails : +EmailAdmins : False +ExcludedDetectionTypes : {} + + This command gets the threat detection policy for a database named Database01. The database is located on the server named Server01, which is assigned to the resource group ResourceGroup11. + + + + + + + + + + + + + Remove-AzureRmSqlDatabaseThreatDetectionPolicy + + + + Set-AzureRmSqlDatabaseThreatDetectionPolicy + + + + Azure SQL Database Cmdlets + + + + @@ -7606,7 +7757,8 @@ FirewallRuleName : rule01 - The Remove-AzureRmSqlDatabaseAuditing cmdlet removes the auditing of an Azure SQL database. To use this cmdlet, use the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. After you run this cmdlet, auditing of the database is not performed. If the command succeeds and you have used the PassThru parameter, the cmdlet returns an object describing the current auditing policy, as well as the database identifiers. Database identifiers include, but are not limited to, the ResourceGroupName, ServerName and DatabaseName. + The Remove-AzureRmSqlDatabaseAuditing cmdlet removes the auditing of an Azure SQL database. To use this cmdlet, use the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. After you run this cmdlet, auditing of the database is not performed. If the command succeeds and you have used the PassThru parameter, the cmdlet returns an object describing the current auditing policy, as well as the database identifiers. Database identifiers include, but are not limited to, the ResourceGroupName, ServerName and DatabaseName. + If you remove auditing of an Azure SQL database, threat detection is also removed. @@ -8223,6 +8375,169 @@ FirewallRuleName : rule01 + + + Remove-AzureRmSqlDatabaseThreatDetectionPolicy + + Removes the threat detection policy from a database. + + + + + Remove + AzureRmSqlDatabaseThreatDetectionPolicy + + + + The Remove-AzureRmSqlDatabaseThreatDetectionPolicy cmdlet removes the threat detection policy from an Azure SQL database. + To use this cmdlet, specify the ResourceGroupName, ServerName and DatabaseName parameters to identify the database from which this cmdlet removes the policy. + + + + Remove-AzureRmSqlDatabaseThreatDetectionPolicy + + ResourceGroupName + + Specifies the name of the resource group the server is assigned to. + + String + + + ServerName + + Specifies the name of a server. + + String + + + DatabaseName + + Specifies the name of a database where the threat detection policy should be removed. + + String + + + PassThru + + Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. + + + + + + + DatabaseName + + Specifies the name of a database where the threat detection policy should be removed. + + String + + String + + + none + + + PassThru + + Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. + + SwitchParameter + + SwitchParameter + + + none + + + ResourceGroupName + + Specifies the name of the resource group the server is assigned to. + + String + + String + + + none + + + ServerName + + Specifies the name of a server. + + String + + String + + + none + + + + + + + + + + + + + You cannot pipe input to this cmdlet. + + + + + + + Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DatabaseThreatDetectionPolicyModel + + + + + + + This cmdlet returns a DatabaseThreatDetectionPolicyModel object. + + + + + + + + Example 1: Remove a threat detection policy for a database + + + + PS C:\> Remove-AzureRmSqlDatabaseThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" + + This command removes the threat detection policy from a database named Database01 on the server named Server01. + + + + + + + + + + + + + Get-AzureRmSqlDatabaseThreatDetectionPolicy + + + + Set-AzureRmSqlDatabaseThreatDetectionPolicy + + + + Azure SQL Database Cmdlets + + + + @@ -10020,397 +10335,371 @@ Tags : - - - - Set-AzureRmSqlDatabaseAuditingPolicy + + + Set-AzureRmSqlDatabaseAuditingPolicy + + Sets the auditing policy for an Azure SQL database. + + + + + Set + AzureRmSqlDatabaseAuditingPolicy + + - Sets the auditing policy for an Azure SQL database. + The Set-AzureRmSqlDatabaseAuditingPolicy cmdlet changes the auditing policy of an Azure SQL database. To use the cmdlet, use the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. Specify the StorageAccountName parameter to specify the storage account to be used for the audit logs and the StorageKeyType parameter to define the storage keys. + You can also define retention for the audit logs table by setting the value of the RetentionInDays and TableIdentifier parameters to define the period and the seed for the audit log table names. Specify the EventType parameter to define which event types to audit. + After the cmdlet runs successfully, auditing of the database is enabled. If the database used the policy of its server for auditing before you ran this cmdlet, auditing stops using that policy. If the cmdlet succeeds and you use the PassThru parameter, it returns an object describing the current auditing policy, as well as the database identifiers. Database identifiers include, but are not limited to, ResourceGroupName, ServerName, and DatabaseName. - - - - Set - AzureRMSqlDatabaseAuditingPolicy - - - - The Set-AzureRmSqlDatabaseAuditingPolicy cmdlet changes the auditing policy of an Azure SQL database. To use the cmdlet, use the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. Specify the StorageAccountName parameter to specify the storage account to be used for the audit logs and the StorageKeyType parameter to define which of that storage keys to use. - You can also define retention for the audit logs table by setting the value of the RetentionInDays and TableIdentifier parameters to define the period and the seed for the names of the audit logs tables. Specify the EventType parameter to define which event types to audit. - After the cmdlet runs successfully, auditing of the database is enabled. If the database used the policy of its server for auditing before you ran this cmdlet, auditing stops using the policy of its server. If the cmdlet succeeds and you use the PassThru parameter, it returns an object describing the current auditing policy, as well as the database identifiers. Database identifiers include, but are not limited to, ResourceGroupName, ServerName, and DatabaseName. - - - - Set-AzureRmSqlDatabaseAuditingPolicy - - PassThru - - Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. - - SwitchParameter - - - EventType - - Specifies the event types to audit. Valid values are: - -- PlainSQL_Success + + + Set-AzureRmSqlDatabaseAuditingPolicy + + ResourceGroupName + + Specifies the name of the resource group that the database is assigned to. + + String + + + ServerName + + Specifies the name of the server that hosts the database. + + String + + + DatabaseName + + Specifies the name of the database. + + String + + + EventType + + Specifies the event types to audit. Valid values are: + -- PlainSQL_Success + -- PlainSQL_Failure + -- ParameterizedSQL_Success + -- ParameterizedSQL_Failure + -- StoredProcedure_Success + -- StoredProcedure_Failure + -- Login_Success + -- Login_Failure + -- TransactionManagement_Success + -- TransactionManagement_Failure + -- All + -- None - You can specify several event types. You can specify All to audit all of the event types or None to specify that no events will be audited. If you specify All or None at the same time, the cmdlet fails to run. - - String[] - - - StorageAccountName - - Specifies the name of the storage account to be used when auditing the database. Wildcards are not permitted. This parameter is not required. When this parameter is not provided, the cmdlet will use the storage account that was defined previously as part of the auditing policy of the database. If this is the first time a database auditing policy is defined and this parameter is not provided, the cmdlet will fail. - - String - - - StorageKeyType - - Specifies which of the storage access keys to use. Valid values are: - -- Primary + You can specify several event types. You can specify All to audit all of the event types or None to specify that no events will be audited. If you specify All or None at the same time, the cmdlet fails to run. + + + PlainSQL_Success + PlainSQL_Failure + ParameterizedSQL_Success + ParameterizedSQL_Failure + StoredProcedure_Success + StoredProcedure_Failure + Login_Success + Login_Failure + TransactionManagement_Success + TransactionManagement_Failure + All + None + + + + PassThru + + Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. + + + + RetentionInDays + + Specifies the number of retention days for the audit logs table. A value of zero (0) means that the table is not retained. The default value is zero. If you specify a value greater than zero, you must specify a value for the TableIdentifer parameter. + + UInt32] + + + StorageAccountName + + Specifies the name of the storage account to be used when auditing the database. Wildcards are not permitted. This parameter is not required. When this parameter is not provided, the cmdlet will use the storage account that was defined previously as part of the auditing policy of the database. If this is the first time a database auditing policy is defined and this parameter is not provided, the cmdlet will fail. + + String + + + StorageKeyType + + Specifies which of the storage access keys to use. Valid values are: + -- Primary + -- Secondary - The default value is Primary. - - String - - - RetentionInDays - - Specifies the number of retention days for the audit logs table. A value of zero (0) means that the table is not retained. The default value is zero. If you specify a value greater than zero, you must specify a value for the TableIdentifer parameter. - - Nullable`1[UInt32] - - - TableIdentifier - - Specifies the name of the audit logs table. Specify this value if you specify a value greater than zero for the RetentionInDays parameter. - - String - - - ThreatDetectionState - - Defines if threat detection is enabled or disabled for this database. - - String - - - NotificationRecipientsEmail - - A semicolon separated list of email addresses to send the alerts to. - - String - - - EmailAdmins - - Defines whether to email service and co-administrators. - - Boolean - - - ExcludedDetectionTypes - - A semicolon separated list of detection types to filter. - - String - - - ServerName - - Specifies the name of the server that contains the database. - - String - - - DatabaseName - - Specifies the name of the database. - - String - - - ResourceGroupName - - Specifies the name of the resource group that contains the database. - - String - - - - - - PassThru - - Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. - - SwitchParameter - - SwitchParameter - - - none - - - EventType - - Specifies the event types to audit. Valid values are: - -- PlainSQL_Success + The default value is Primary. + + + Primary + Secondary + + + + TableIdentifier + + Specifies the name of the audit logs table. Specify this value if you specify a value greater than zero for the RetentionInDays parameter. + + String + + + + + + DatabaseName + + Specifies the name of the database. + + String + + String + + + none + + + EventType + + Specifies the event types to audit. Valid values are: + -- PlainSQL_Success + -- PlainSQL_Failure + -- ParameterizedSQL_Success + -- ParameterizedSQL_Failure + -- StoredProcedure_Success + -- StoredProcedure_Failure + -- Login_Success + -- Login_Failure + -- TransactionManagement_Success + -- TransactionManagement_Failure + -- All + -- None - You can specify several event types. You can specify All to audit all of the event types or None to specify that no events will be audited. If you specify All or None at the same time, the cmdlet fails to run. - - String[] - - String[] - - - none - - - StorageAccountName - - Specifies the name of the storage account to be used when auditing the database. Wildcards are not permitted. This parameter is not required. When this parameter is not provided, the cmdlet will use the storage account that was defined previously as part of the auditing policy of the database. If this is the first time a database auditing policy is defined and this parameter is not provided, the cmdlet will fail. - - String - - String - - - none - - - StorageKeyType - - Specifies which of the storage access keys to use. Valid values are: - -- Primary + You can specify several event types. You can specify All to audit all of the event types or None to specify that no events will be audited. If you specify All or None at the same time, the cmdlet fails to run. + + String[] + + String[] + + + none + + + PassThru + + Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. + + SwitchParameter + + SwitchParameter + + + none + + + ResourceGroupName + + Specifies the name of the resource group that the database is assigned to. + + String + + String + + + none + + + RetentionInDays + + Specifies the number of retention days for the audit logs table. A value of zero (0) means that the table is not retained. The default value is zero. If you specify a value greater than zero, you must specify a value for the TableIdentifer parameter. + + UInt32] + + UInt32] + + + none + + + ServerName + + Specifies the name of the server that hosts the database. + + String + + String + + + none + + + StorageAccountName + + Specifies the name of the storage account to be used when auditing the database. Wildcards are not permitted. This parameter is not required. When this parameter is not provided, the cmdlet will use the storage account that was defined previously as part of the auditing policy of the database. If this is the first time a database auditing policy is defined and this parameter is not provided, the cmdlet will fail. + + String + + String + + + none + + + StorageKeyType + + Specifies which of the storage access keys to use. Valid values are: + -- Primary + -- Secondary - The default value is Primary. - - String - - String - - - none - - - RetentionInDays - - Specifies the number of retention days for the audit logs table. A value of zero (0) means that the table is not retained. The default value is zero. If you specify a value greater than zero, you must specify a value for the TableIdentifer parameter. - - Nullable`1[UInt32] - - Nullable`1[UInt32] - - - none - - - TableIdentifier - - Specifies the name of the audit logs table. Specify this value if you specify a value greater than zero for the RetentionInDays parameter. - - String - - String - - - none - - - ServerName - - Specifies the name of the server that contains the database. - - String - - String - - - none - - - DatabaseName - - Specifies the name of the database. - - String - - String - - - none - - - ResourceGroupName - - Specifies the name of the resource group that contains the database. - - String - - String - - - none - - - Profile - - Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. - - azureprofile - - azureprofile - - - none - - - - - - - - - - - - - - - - - - - - Microsoft.Azure.Commands.Sql.Security.Model.DatabaseAuditingPolicyModel - - - - - - - - - - - - - - - - - - - Keywords: azure, azurerm, arm, resource, management, manager, sql, database, mssql - - - - - -------------------------- Example 1: Set the auditing policy of a database -------------------------- - - PS C:\> - - PS C:\> Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database01" -StorageAccountName "Storage31" - - This command sets the auditing policy of database named database01 located in server01 to use the storage account named Storage31. - - - - - - - - - - - - - - - -------------------------- Example 2: Set the storage account key of an existing auditing policy of a database -------------------------- - - PS C:\> - - PS C:\> Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database01" -StorageAccountKey Secondary - - This command sets the auditing policy of database named database01 located in server01 to keep using the same storage account name, but use the secondary key. - - - - - - - - - - - - - - - -------------------------- Example 3: Set the auditing policy of a database to use a specific event type -------------------------- - - PS C:\> - - PS C:\> Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database01" -EventType Login_Failure - - This command sets the auditing policy of database named database01 located in server01 to log the Login_Failure event type. The command does not change the storage settings. - - - - - - - - - - - - - - - - - Get-AzureRmSqlDatabaseAuditingPolicy - - - - - Remove-AzureRmSqlDatabaseAuditing - - - - - Azure SQL Database - - - - - + The default value is Primary. + + String + + String + + + none + + + TableIdentifier + + Specifies the name of the audit logs table. Specify this value if you specify a value greater than zero for the RetentionInDays parameter. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + Microsoft.Azure.Commands.Sql.Security.Model.DatabaseAuditingPolicyModel + + + + + + + + + + + + + + + Example 1: Set the auditing policy of a database + + + + PS C:\> Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database01" -StorageAccountName "Storage31" + + This command sets the auditing policy of database named database01 located on server01 to use the storage account named Storage31. + + + + + + + + + + + Example 2: Set the storage account key of an existing auditing policy of a database + + + + PS C:\> Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database01" -StorageAccountKey Secondary + + This command sets the auditing policy of database named database01 located on server01 to keep using the same storage account name but to now use the secondary key. + + + + + + + + + + + Example 3: Set the auditing policy of a database to use a specific event type + + + + PS C:\> Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database01" -EventType Login_Failure + + This command sets the auditing policy of database named database01 located on server01; the policy will log the Login_Failure event type. The command does not change the storage settings. + + + + + + + + + + + + + Get-AzureRmSqlDatabaseAuditingPolicy + + + + Remove-AzureRmSqlDatabaseAuditing + + + + Azure SQL Database Cmdlets + + + + @@ -11304,6 +11593,244 @@ Tags : + + + Set-AzureRmSqlDatabaseThreatDetectionPolicy + + Sets a threat detection policy on a database. + + + + + Set + AzureRmSqlDatabaseThreatDetectionPolicy + + + + The Set-AzureRmSqlDatabaseThreatDetectionPolicy cmdlet sets a threat detection policy on an Azure SQL database. In order to enable threat detection on a database an auditing policy must be enabled on that database. + To use this cmdlet, specify the ResourceGroupName, ServerName and DatabaseName parameters to identify the database. + + + + Set-AzureRmSqlDatabaseThreatDetectionPolicy + + ResourceGroupName + + Specifies the name of the resource group the server is assigned to. + + String + + + ServerName + + Specifies the name of the server. + + String + + + DatabaseName + + Specifies the name of the database where the policy will be set. + + String + + + EmailAdmins + + Specifies whether the threat detection policy contacts administrators by using email. + + Boolean] + + + ExcludedDetectionType + + Specifies an array of detection types to exclude from the policy. Valid values are: + +-- Sql_Injection +-- Sql_Injection_Vulnerability +-- Access_Anomaly +-- Usage_Anomaly +-- None + + + Sql_Injection + Sql_Injection_Vulnerability + Access_Anomaly + Usage_Anomaly + None + + + + NotificationRecipientsEmails + + Specifies a semicolon-separated list of email addresses to which the policy sends alerts. + + String + + + PassThru + + Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. + + + + + + + DatabaseName + + Specifies the name of the database where the policy will be set. + + String + + String + + + none + + + EmailAdmins + + Specifies whether the threat detection policy contacts administrators by using email. + + Boolean] + + Boolean] + + + none + + + ExcludedDetectionType + + Specifies an array of detection types to exclude from the policy. Valid values are: + +-- Sql_Injection +-- Sql_Injection_Vulnerability +-- Access_Anomaly +-- Usage_Anomaly +-- None + + String[] + + String[] + + + none + + + NotificationRecipientsEmails + + Specifies a semicolon-separated list of email addresses to which the policy sends alerts. + + String + + String + + + none + + + PassThru + + Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. + + SwitchParameter + + SwitchParameter + + + none + + + ResourceGroupName + + Specifies the name of the resource group the server is assigned to. + + String + + String + + + none + + + ServerName + + Specifies the name of the server. + + String + + String + + + none + + + + + + + + + + + + + You cannot pipe input to this cmdlet. + + + + + + + Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DatabaseThreatDetectionPolicyModel + + + + + + + This cmdlet returns a Model.DatabaseThreatDetectionPolicyModel object. + + + + + + + + Example 1: Set the threat detection policy for a database + + + + PS C:\> Set-AzureRmSqlDatabaseThreatDetectionPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability", "SQL_Injection" + + This command sets the threat detection policy for a database named Database01 on the server named Server01. + + + + + + + + + + + + + Get-AzureRmSqlDatabaseThreatDetectionPolicy + + + + Remove-AzureRmSqlDatabaseThreatDetectionPolicy + + + + Azure SQL Database Cmdlets + + + + @@ -13919,7 +14446,8 @@ The final command upgrades the existing server named server02 in the resource g - The Use-AzureRmSqlServerAuditingPolicy cmdlet specifies that a database uses the auditing policy of its host server. Specify the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. If no auditing policy is defined for the database server, this cmdlet fails. + The Use-AzureRmSqlServerAuditingPolicy cmdlet specifies that a database uses the auditing policy of its host server. Specify the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. If no auditing policy is defined for the database server, this cmdlet fails. + If the host uses server level auditing, threat detection is removed.