Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions src/azure-cli/azure/cli/command_modules/sql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,12 @@
type: command
short-summary: Create a managed instance.
examples:
- name: Create a managed instance with specified parameters and with identity
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --license-type LicenseIncluded --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} --capacity 8 --storage 32GB --edition GeneralPurpose --family Gen4
- name: Create a managed instance with minimal set of parameters
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName}
- name: Create a managed instance with specified parameters and with identity
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --license-type LicenseIncluded --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} --capacity 8 --storage 32GB --edition GeneralPurpose --family Gen5
- name: Create managed instance with specified parameters and tags
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --license-type LicenseIncluded --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} --capacity 8 --storage 32GB --edition GeneralPurpose --family Gen5 --tags tagName1=tagValue1 tagName2=tagValue2
"""

helps['sql mi delete'] = """
Expand Down Expand Up @@ -709,6 +711,10 @@
text: az sql mi update -g mygroup -n myinstance -i -p mypassword --license-type mylicensetype --capacity vcorecapacity --storage storagesize
- name: Update mi edition and hardware family
text: az sql mi update -g mygroup -n myinstance --tier GeneralPurpose --family Gen5
- name: Add or update a tag.
text: az sql mi update -g mygroup -n myinstance --set tags.tagName=tagValue
- name: Remove a tag.
text: az sql mi update -g mygroup -n myinstance --remove tags.tagName
- name: Update a managed instance. (autogenerated)
text: az sql mi update --name myinstance --proxy-override Default --resource-group mygroup --subscription MySubscription
crafted: true
Expand Down
4 changes: 4 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 @@ -1443,6 +1443,8 @@ def _configure_security_policy_storage_params(arg_ctx):
help='The time zone id for the instance to set. '
'A list of time zone ids is exposed through the sys.time_zone_info (Transact-SQL) view.')

c.argument('tags', arg_type=tags_type)

with self.argument_context('sql mi create') as c:
c.argument('location',
arg_type=get_location_type_with_default_from_resource_group(self.cli_ctx))
Expand All @@ -1461,6 +1463,7 @@ def _configure_security_policy_storage_params(arg_ctx):
'proxy_override',
'public_data_endpoint_enabled',
'timezone_id',
'tags',
])

# Create args that will be used to build up the Managed Instance's Sku object
Expand Down Expand Up @@ -1502,6 +1505,7 @@ def _configure_security_policy_storage_params(arg_ctx):
create_args_for_complex_type(
c, 'parameters', ManagedInstance, [
'administrator_login_password',
'tags',
])

c.argument('administrator_login_password',
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 @@ -2661,7 +2661,8 @@ def managed_instance_update(
public_data_endpoint_enabled=None,
tier=None,
family=None,
minimal_tls_version=None):
minimal_tls_version=None,
tags=None):
'''
Updates a managed instance. Custom update function to apply parameters to instance.
'''
Expand Down Expand Up @@ -2697,6 +2698,9 @@ def managed_instance_update(
if public_data_endpoint_enabled is not None:
instance.public_data_endpoint_enabled = public_data_endpoint_enabled

if tags is not None:
instance.tags = tags

return instance


Expand Down
Loading