Skip to content

Commit

Permalink
Added isManagedIdentityInUse get parameter for Get-AzSqlServerAudit
Browse files Browse the repository at this point in the history
… and `Get-AzSqlDatabaseAudit` (#18703)

* added isManagedIdentityInUse get parameter

* added changes to changelog

Co-authored-by: Ilias Khan <[email protected]>
  • Loading branch information
IliasKhan and iliaskha authored Jun 27, 2022
1 parent 7e6f49b commit ede853d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Sql/Sql/Auditing/Model/ServerDevOpsAuditModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ public class ServerDevOpsAuditModel

[Hidden]
internal string NextDiagnosticSettingsName { get; set; }

public bool? IsManagedIdentityInUse { get; set; }
}
}
8 changes: 5 additions & 3 deletions src/Sql/Sql/Auditing/Services/SqlAuditAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ internal void ModelizeAuditPolicy(AuditModelType model,
bool? isSecondary,
Guid? storageAccountSubscriptionId,
bool? isAzureMonitorTargetEnabled,
int? retentionDays)
int? retentionDays,
bool? isManagedIdentityInUse)
{
model.IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled;
model.IsManagedIdentityInUse = isManagedIdentityInUse;

ModelizeStorageInfo(model, storageEndpoint, isSecondary, storageAccountSubscriptionId, IsAuditEnabled(state), retentionDays);
DetermineTargetsState(model, state);
Expand Down Expand Up @@ -707,7 +709,7 @@ protected override void ModelizeAuditPolicy(AuditModelType model, ExtendedAuditP
ModelizeAuditPolicy(model,
dynamicPolicy.State, dynamicPolicy.StorageEndpoint, dynamicPolicy.IsStorageSecondaryKeyInUse,
dynamicPolicy.StorageAccountSubscriptionId, dynamicPolicy.IsAzureMonitorTargetEnabled,
dynamicPolicy.RetentionDays);
dynamicPolicy.RetentionDays, dynamicPolicy.IsManagedIdentityInUse);

model.PredicateExpression = dynamicPolicy.PredicateExpression;
model.AuditActionGroup = ExtractAuditActionGroups(dynamicPolicy.AuditActionsAndGroups);
Expand Down Expand Up @@ -969,7 +971,7 @@ protected override void ModelizeAuditPolicy(ServerDevOpsAuditModel model, Server
{
ModelizeAuditPolicy(model,
policy.State, policy.StorageEndpoint, null, policy.StorageAccountSubscriptionId,
policy.IsAzureMonitorTargetEnabled, null);
policy.IsAzureMonitorTargetEnabled, null, null);
}

protected override StorageKeyKind GetStorageKeyKind(ServerDevOpsAuditModel model)
Expand Down
1 change: 1 addition & 0 deletions src/Sql/Sql/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
## Upcoming Release
* Added additional input validation to `Stop-AzSqlInstanceDatabaseLogReplay` cmdlet to ensure the target database was created by log replay service
* Bug fix for cmdlet `Restore-AzSqlDatabase`. The optional property `Tags` was not working as expected
* Added isManagedIdentityInUse get parameter for `Get-AzSqlServerAudit` and `Get-AzSqlDatabaseAudit`

## Version 3.9.0
* Added new cmdlet `Get-AzSqlInstanceEndpointCertificate`
Expand Down

0 comments on commit ede853d

Please sign in to comment.