Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
272bc6c
In progress - rollback delete is missing
Sep 21, 2020
cc8b58a
Added help
Sep 22, 2020
17e8e32
Added help
Sep 22, 2020
1244360
Working on rollback
Sep 23, 2020
00c9ed2
Fix '_get_diagnostic_settings_url' for server case
Sep 30, 2020
75a7998
Merge pull request #1 from Azure/dev
OlegSternbergIBM Oct 1, 2020
2d95e5f
Merge branch 'dev' into olsternb_la_eh_support
Oct 1, 2020
08c61b9
update help
Oct 2, 2020
ee74775
fix storage account and endpoint handling
Oct 2, 2020
1c3f5ef
update test - server tests still fail with:
Oct 3, 2020
9dd9218
Add log analytics test for db audit
Oct 4, 2020
b2f718c
use bool condition for test mode
Oct 5, 2020
72b89be
enrich db audit policy tests
Oct 5, 2020
04c05f3
fix case when blob_storage_target_state is not provided
Oct 6, 2020
67b1371
fix diagnostic settings rollback
Oct 6, 2020
3e0601d
Tune server and db tests.
Oct 7, 2020
6a58c06
Wait on LROPoller for server operations
Oct 7, 2020
f559d23
remove timeouts
Oct 7, 2020
eec92bb
_audit_policy_update_global_settings cosmetic
Oct 8, 2020
c45ce1f
use proper --event-hub argument name
Oct 9, 2020
f530b90
Merge pull request #2 from Azure/dev
OlegSternbergIBM Oct 9, 2020
b4cb062
merge from main repository
Oct 9, 2020
0f94774
merge from main repository - resolve conflicts
Oct 9, 2020
b9db040
code style
Oct 9, 2020
adbda62
code style
Oct 9, 2020
6d00cb5
code style
Oct 9, 2020
5827b95
code style
Oct 10, 2020
060e819
code style
Oct 10, 2020
284d669
code style
Oct 10, 2020
6c37b84
support --no-wait in 'server audit-policy update'
Oct 10, 2020
9ebdb55
code style check passed
Oct 10, 2020
b65fd63
optimize if-else
Oct 11, 2020
d99010e
remane to 'fetch...'
Oct 11, 2020
b442bbc
fix audit_policy_update logic in terms of azure monitor
Oct 11, 2020
63100c9
code style
Oct 11, 2020
1bf6211
remove unused arguments
Oct 11, 2020
4fc1095
linter
Oct 11, 2020
81803fd
use is_storage_secondary_key_in_use from audit_policy
Oct 12, 2020
4348704
fix typo
Oct 12, 2020
faaaa7b
validate --retention-days argument
Oct 12, 2020
db3669f
fix error description
Oct 12, 2020
ca2b3b4
bound retention_days from top
Oct 12, 2020
978ce99
fix 'has_other_categories'
Oct 13, 2020
a527649
fix positional arguments comments
Oct 17, 2020
e427864
reuse cf_monitor
Oct 17, 2020
fb98212
added 'wait' command
Oct 17, 2020
6a4a1a8
fix 'wait' command help
Oct 17, 2020
815effe
register 'wait' as last command
Oct 18, 2020
0a7b172
update 'wait' help
Oct 20, 2020
23325c3
us 'cmd.get_models' to obtain model classes
Oct 20, 2020
c03d3c5
use 'generic_update_command' for server and db audit-policy update
Oct 20, 2020
45770b6
style fixes
Oct 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix storage account and endpoint handling
  • Loading branch information
Oleg Sternberg committed Oct 2, 2020
commit ee747752adda1ec29fbb581acdb5eeea323f3567
18 changes: 16 additions & 2 deletions src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,14 +1862,28 @@ def _audit_policy_update_global_settings(
# Apply blob_storage_target_state and all storage account details
if blob_storage_target_state != None:
if blob_storage_target_state.lower() == BlobAuditingPolicyState.enabled.value.lower():
storage_resource_group = None

# Resolve storage endpoint in case storage account has been provided.
# Error is thrown in case storage endpoint cannot be resolved.
if storage_account != None:
storage_resource_group = _find_storage_account_resource_group(cmd.cli_ctx, storage_account)
storage_endpoint = _get_storage_endpoint(cmd.cli_ctx, storage_account, storage_resource_group)
storage_endpoint = _get_storage_endpoint(cmd.cli_ctx, storage_account, storage_resource_group)

audit_policy.storage_endpoint = storage_endpoint;
audit_policy.storage_account_access_key = storage_account_access_key

if storage_account_access_key != None:
audit_policy.storage_account_access_key = storage_account_access_key
else:
if storage_account == None:
storage_account = _get_storage_account_name(storage_endpoint)
storage_resource_group = _find_storage_account_resource_group(cmd.cli_ctx, storage_account)

audit_policy.storage_account_access_key = _get_storage_key(
cmd.cli_ctx,
storage_account,
storage_resource_group,
False)
else:
audit_policy.storage_endpoint = None;
audit_policy.storage_account_access_key = None
Expand Down