Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQL] az sql mi update: Add --subnet and --vnet-name parameters to support the cross subnet update SLO #18886

Merged
merged 48 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1f7cec0
Update sql track2
ericshape Jun 25, 2021
c58dd49
Update commands.py
ericshape Jun 25, 2021
ab35e4d
update setter_name to pass sdk validation
ericshape Jun 25, 2021
d9f6723
replace_all_delete
ericshape Jun 25, 2021
224d210
pass az self-check
ericshape Jun 25, 2021
723d398
Merge branch 'dev' into add_track2_sdk
ericshape Jun 28, 2021
4599371
update recording tests
ericshape Jun 28, 2021
9664295
fix all begin_xyz issue
ericshape Jun 29, 2021
3afea39
run test to unblock some issues
ericshape Jun 29, 2021
8726c3e
pass SqlServerMSSupportScenarioTest
ericshape Jun 29, 2021
ce4cd77
change region to pass tests
ericshape Jun 29, 2021
0d1de91
pass LTR test
ericshape Jun 29, 2021
a2ce917
Merge branch 'Azure:dev' into add_track2_sdk
ericshape Jun 30, 2021
9b3f324
add recorded tests for MI
ericshape Jun 30, 2021
365ee3d
update db_rename parameters
ericshape Jul 1, 2021
8cf268f
pass db management tests
ericshape Jul 1, 2021
e831b34
address aad tests
ericshape Jul 1, 2021
a6ad19a
pass sql server aad
ericshape Jul 2, 2021
4c0d5a6
Merge branch 'dev' into add_track2_sdk
ericshape Jul 2, 2021
3ca5058
revert azure-mgmt-netapp version change
ericshape Jul 2, 2021
09c83e0
record test after rebase
ericshape Jul 2, 2021
04ad03e
add three passed tests
ericshape Jul 2, 2021
3bb875f
modify short term policy
ericshape Jul 2, 2021
9942d30
complete another three tests
ericshape Jul 2, 2021
a46c671
pass tde test
ericshape Jul 3, 2021
207a78f
pass two more tests
ericshape Jul 4, 2021
3dc1278
Update custom.py
ericshape Jul 4, 2021
72428d3
pass two more tests
ericshape Jul 5, 2021
caffca8
pass classification test
ericshape Jul 6, 2021
4d3cf1d
pass long and short backup
ericshape Jul 7, 2021
dc14663
update test file to match new config
ericshape Jul 7, 2021
ef8e0b6
pass server and db security tests
ericshape Jul 8, 2021
574cacd
record test_sql_db_sensitivity_classifications again
ericshape Jul 8, 2021
b4b751a
update MI tests
ericshape Jul 14, 2021
0626658
pass MI tests
ericshape Jul 14, 2021
c0e0e48
Merge branch 'dev' into add_track2_sdk
ericshape Jul 14, 2021
96d94d9
pass tests
ericshape Jul 14, 2021
2b69b66
modify instance_pool_test
ericshape Jul 15, 2021
a15c942
Merge branch 'add_track2_sdk' of https://github.com/ericshape/azure-c…
Jul 15, 2021
58c46c8
Iteration 1:
Jul 15, 2021
d381f24
Iteration 2:
Jul 15, 2021
34d1477
Merge remote-tracking branch 'upstream/dev' into nemanjas/subnet_id
Jul 30, 2021
db33c1d
Iteration 3:
Jul 30, 2021
492f189
Iteration 4:
Jul 30, 2021
4c39113
Iteration 5:
Jul 30, 2021
a8c3e4a
Iteration 6:
Jul 30, 2021
51efe4d
Iteration 7:
Jul 30, 2021
812654a
Iteration 7:
Jul 30, 2021
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
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/sql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,13 @@
text: az sql mi update -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
- name: Update a managed instance with User Managed Identies and Identity Type is UserAssigned.
- name: Update a managed instance with User Managed Identies and Identity Type is UserAssigned
text: az sql mi update -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
- name: Move managed instance to another subnet
text: az sql mi update -g myResourceGroup -n myServer -i \\
--subnet /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
"""

helps['sql midb'] = """
Expand Down
11 changes: 11 additions & 0 deletions src/azure-cli/azure/cli/command_modules/sql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,17 @@ def _configure_security_policy_storage_params(arg_ctx):

c.ignore('name') # Hide sku name

c.extra('vnet_name',
options_list=['--vnet-name'],
help='The virtual network name',
validator=validate_subnet)

c.argument('virtual_network_subnet_id',
options_list=['--subnet'],
required=False,
help='Name or ID of the subnet that allows access to an Azure Sql Managed Instance. '
'If subnet name is provided, --vnet-name must be provided.')

with self.argument_context('sql mi show') as c:
c.argument('expand_ad_admin',
options_list=['--expand-ad-admin'],
Expand Down
6 changes: 5 additions & 1 deletion src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4313,7 +4313,8 @@ def managed_instance_update(
primary_user_assigned_identity_id=None,
key_id=None,
identity_type=None,
user_assigned_identity_id=None):
user_assigned_identity_id=None,
virtual_network_subnet_id=None):
'''
Updates a managed instance. Custom update function to apply parameters to instance.
'''
Expand Down Expand Up @@ -4362,6 +4363,9 @@ def managed_instance_update(

instance.key_id = (key_id or instance.key_id)

if virtual_network_subnet_id is not None:
instance.subnet_id = virtual_network_subnet_id

return instance


Expand Down
Loading