Skip to content

Set-AzSqlServerAudit not working for LogAnalytics workspace generates error in latest version of Az.sql (4.2.0) #20703

Closed
@ar3c

Description

Description

Running the PowerShell command to configure auditing generated an error. The same command works in version 4.1.0 of Az.sql.

Set-AzSqlServerAudit -ResourceGroupName "myrg" -ServerName "myserver" -LogAnalyticsTargetState Enabled -WorkspaceResourceId "/subscriptions/xxxxxxxxxx/resourcegroups/myrg/providers/microsoft.operationalinsights/workspaces/mywsnamehere

The error states that Workspace resource id not provided.

Issue script & Debug output

The error states that Workspace resource id not provided.

Environment data

Name                           Value                                                                                                                                                                                                                             
----                           -----                                                                                                                                                                                                                             
PSVersion                      5.1.19041.2364                                                                                                                                                                                                                    
PSEdition                      Desktop                                                                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                           
BuildVersion                   10.0.19041.2364                                                                                                                                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                               
SerializationVersion           1.1.0.1

Module versions

cript     2.11.1     Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}                                                                                                                               
Script     4.2.0      Az.Sql                              {Add-AzSqlDatabaseToFailoverGroup, Add-AzSqlElasticJobStep, Add-AzSqlElasticJobTarget, Add-AzSqlInstanceKeyVaultKey...}

Error output

The error states that Workspace resource id not provided.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

CXP Attention[Deprecated] The Azure CXP Support Team is responsible for this issue.SQLbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedneeds-team-attentionThis issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions