From 80443f9a12886bfd087a74d865b8c294035febae Mon Sep 17 00:00:00 2001 From: Ilias Khan Date: Fri, 24 Jun 2022 10:15:23 +0530 Subject: [PATCH 1/2] added isManagedIdentityInUse get parameter --- src/Sql/Sql/Auditing/Model/ServerDevOpsAuditModel.cs | 2 ++ src/Sql/Sql/Auditing/Services/SqlAuditAdapter.cs | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Sql/Sql/Auditing/Model/ServerDevOpsAuditModel.cs b/src/Sql/Sql/Auditing/Model/ServerDevOpsAuditModel.cs index 62a338e2c808..f093e350428e 100644 --- a/src/Sql/Sql/Auditing/Model/ServerDevOpsAuditModel.cs +++ b/src/Sql/Sql/Auditing/Model/ServerDevOpsAuditModel.cs @@ -48,5 +48,7 @@ public class ServerDevOpsAuditModel [Hidden] internal string NextDiagnosticSettingsName { get; set; } + + public bool? IsManagedIdentityInUse { get; set; } } } diff --git a/src/Sql/Sql/Auditing/Services/SqlAuditAdapter.cs b/src/Sql/Sql/Auditing/Services/SqlAuditAdapter.cs index 918de61d88ce..e7f1507c9c70 100644 --- a/src/Sql/Sql/Auditing/Services/SqlAuditAdapter.cs +++ b/src/Sql/Sql/Auditing/Services/SqlAuditAdapter.cs @@ -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); @@ -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); @@ -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) From 03e74c0f1981b723bd33f575b9de32988a884414 Mon Sep 17 00:00:00 2001 From: Ilias Khan Date: Fri, 24 Jun 2022 10:51:59 +0530 Subject: [PATCH 2/2] added changes to changelog --- src/Sql/Sql/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Sql/Sql/ChangeLog.md b/src/Sql/Sql/ChangeLog.md index a84abe8571a6..0df661183a6f 100644 --- a/src/Sql/Sql/ChangeLog.md +++ b/src/Sql/Sql/ChangeLog.md @@ -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`