Skip to content

Commit 0f8e352

Browse files
committed
bugfix: change in storage others then name
1 parent 6689193 commit 0f8e352

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/ResourceManager/Sql/Commands.Sql/Auditing/Cmdlet/SetAzureSqlDatabaseAuditingPolicy.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected override DatabaseAuditingPolicyModel ApplyUserInputToModel(DatabaseAud
9191
if (StorageAccountName != null)
9292
{
9393
model.StorageAccountName = StorageAccountName;
94+
ModelAdapter.ClearStorageDetailsCache();
9495
}
9596
if (!string.IsNullOrEmpty(StorageKeyType)) // the user enter a key type - we use it (and running over the previously defined key type)
9697
{

src/ResourceManager/Sql/Commands.Sql/Auditing/Cmdlet/SetAzureSqlServerAuditingPolicy.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ protected override ServerAuditingPolicyModel ApplyUserInputToModel(ServerAuditin
9696
if (StorageAccountName != null)
9797
{
9898
model.StorageAccountName = StorageAccountName;
99+
ModelAdapter.ClearStorageDetailsCache();
99100
}
100101
if (!string.IsNullOrEmpty(StorageKeyType)) // the user enter a key type - we use it (and running over the previously defined key type)
101102
{

src/ResourceManager/Sql/Commands.Sql/Auditing/Services/SqlAuditAdapter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,5 +480,13 @@ private string ExtractStorageAccountKey(string storageName, BaseAuditingPolicyMo
480480
}
481481
return null;
482482
}
483+
484+
internal void ClearStorageDetailsCache()
485+
{
486+
FetchedStorageAccountName = null;
487+
FetchedStorageAccountResourceGroup = null;
488+
FetchedStorageAccountSubscription = null;
489+
FetchedStorageAccountTableEndpoint = null;
490+
}
483491
}
484492
}

src/ResourceManager/Sql/Commands.Sql/Common/SecurityConstants.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public class SecurityConstants
5252
{TransactionManagement_Failure, AuditEventType.TransactionManagement_Failure}
5353
};
5454

55-
//id to locate a server's security policy
56-
public const string ServerPolicyId = "c3d905bb-e460-48bb-884d-75fac8f63e11";
57-
5855
public const string Primary = "Primary";
5956
public const string Secondary = "Secondary";
6057

@@ -103,8 +100,6 @@ public class AuditingEndpoint
103100
/// </summary>
104101
public class DataMaskingEndpoint
105102
{
106-
public const string Standard = "Relaxed";
107-
public const string Extended = "Restricted";
108103
public const string Enabled = "Enabled";
109104
public const string Disabled = "Disabled";
110105

0 commit comments

Comments
 (0)