Getting Error while enabling Audit on Azure SQL DB

Vijay Kumar 2,016 Reputation points
2022-05-25T00:49:36.413+00:00

Hi Team,

I am using below Powershell script:

Set-AzureRmSqlDatabaseAuditing -ResourceGroupName "resourcegroup123"
-ServerName "sqlazureserver1234.database.windows.net" -DatabaseName "db123"
-StorageAccountName "storage1234"
-AuditActionGroup "SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP", "FAILED_DATABASE_AUTHENTICATION_GROUP", "BATCH_COMPLETED_GROUP"
-AuditAction "SELECT ON DBO.ALWNC_HDR BY public"
-AuditAction "DELETE ON DBO.ALWNC_HDR BY public"
-AuditAction "UPDATE ON DBO.ALWNC_HDR BY public"
-AuditAction "INSERT ON DBO.ALWNC_HDR BY public"
-AuditAction "SELECT ON DBO.BILL_REC_HDR BY public"
-AuditAction "DELETE ON DBO.BILL_REC_HDR BY public"
-AuditAction "UPDATE ON DBO.BILL_REC_HDR BY public"
-AuditAction "INSERT ON DBO.BILL_REC_HDR BY public"
-RetentionInDays 8

Here is the error:

Set-AzureRmSqlDatabaseAuditing : The term 'Set-AzureRmSqlDatabaseAuditing' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1

  • Set-AzureRmSqlDatabaseAuditing -ResourceGroupName "az-entaks-nonprod- ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Set-AzureRmSqlDatabaseAuditing:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException
Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 32,886 Reputation points MVP
    2022-05-25T02:44:46.95+00:00

    Please install the AzureRM.Sql PowerShell module first.

    Be aware that Microsoft will retire AzureRM PowerShell modules on 29 February 2024, in favor of the Az PowerShell modules. Try to


0 additional answers

Sort by: Most helpful