Share via


az sql mi

Manage SQL managed instances.

Commands

Name Description Type Status
az sql mi ad-admin

Manage a managed instance's Active Directory administrator.

Core GA
az sql mi ad-admin create

Creates a new managed instance Active Directory administrator.

Core GA
az sql mi ad-admin delete

Deletes an existing managed instance Active Directory Administrator.

Core GA
az sql mi ad-admin list

Returns a list of managed instance Active Directory Administrators.

Core GA
az sql mi ad-admin update

Updates an existing managed instance Active Directory administrator.

Core GA
az sql mi ad-only-auth

Manage a Managed Instance's Azure Active Directory only settings.

Core GA
az sql mi ad-only-auth disable

Disable Azure Active Directory only Authentication for this Managed Instance.

Core GA
az sql mi ad-only-auth enable

Enable Azure Active Directory only Authentication for this Managed Instance.

Core GA
az sql mi ad-only-auth get

Get a specific Azure Active Directory only Authentication property.

Core GA
az sql mi advanced-threat-protection-setting

Manage a SQL Managed Instance's advanced threat protection setting.

Core GA
az sql mi advanced-threat-protection-setting show

Gets an advanced threat protection setting.

Core GA
az sql mi advanced-threat-protection-setting update

Update a SQL Managed Instance's advanced threat protection setting.

Core GA
az sql mi create

Create a managed instance.

Core GA
az sql mi delete

Delete a managed instance.

Core GA
az sql mi dtc

Commands related to managed instance DTC management.

Core GA
az sql mi dtc show

Get managed instance DTC settings.

Core GA
az sql mi dtc update

Update managed instance DTC settings.

Core GA
az sql mi dtc wait

Place the CLI in a waiting state until a condition is met.

Core GA
az sql mi endpoint-cert

Endpoint certificates management commands.

Core GA
az sql mi endpoint-cert list

List certificates used on endpoints on the target instance.

Core GA
az sql mi endpoint-cert show

Get a certificate used on the endpoint with the given id.

Core GA
az sql mi failover

Failover a managed instance.

Core GA
az sql mi key

Manage a SQL Instance's keys.

Core GA
az sql mi key create

Creates a SQL Instance key.

Core GA
az sql mi key delete

Deletes a SQL Instance key.

Core GA
az sql mi key list

Gets a list of managed instance keys.

Core GA
az sql mi key show

Shows a SQL Instance key.

Core GA
az sql mi link

Instance link management commands.

Core GA
az sql mi link create

Creates a new instance link.

Core GA
az sql mi link delete

Removes an instance link.

Core GA
az sql mi link list

Returns information about link feature for Azure SQL Managed Instance.

Core GA
az sql mi link show

Returns information about link feature for Azure SQL Managed Instance.

Core GA
az sql mi link update

Updates the properties of an instance link.

Core GA
az sql mi list

List available managed instances.

Core GA
az sql mi op

Manage operations on a managed instance.

Core GA
az sql mi op cancel

Cancels the asynchronous operation on the managed instance.

Core GA
az sql mi op list

Gets a list of operations performed on the managed instance.

Core GA
az sql mi op show

Gets a management operation on a managed instance.

Core GA
az sql mi partner-cert

Server trust certificate management commands.

Core GA
az sql mi partner-cert create

Upload a server trust certificate from box to Sql Managed Instance.

Core GA
az sql mi partner-cert delete

Delete a server trust certificate that was uploaded from box to Sql Managed Instance.

Core GA
az sql mi partner-cert list

Get a list of server trust certificates that were uploaded from box to the given Sql Managed Instance.

Core GA
az sql mi partner-cert show

Get a server trust certificate that was uploaded from box to Sql Managed Instance.

Core GA
az sql mi refresh-external-governance-status

Refresh external governance enablement status.

Core GA
az sql mi server-configuration-option

Server configuration option management commands.

Core GA
az sql mi server-configuration-option list

List a list of managed instance server configuration options.

Core GA
az sql mi server-configuration-option set

Set managed instance server configuration option.

Core GA
az sql mi server-configuration-option show

Get managed instance server configuration option.

Core GA
az sql mi server-configuration-option wait

Place the CLI in a waiting state until a condition is met.

Core GA
az sql mi show

Get the details for a managed instance.

Core GA
az sql mi start

Start the managed instance.

Core GA
az sql mi start-stop-schedule

Manage the managed instance's start stop schedule.

Core GA
az sql mi start-stop-schedule create

Create the managed instance's Start/Stop schedule.

Core GA
az sql mi start-stop-schedule delete

Delete the managed instance's Start/Stop schedule.

Core GA
az sql mi start-stop-schedule list

List the managed instance's Start/Stop schedules.

Core GA
az sql mi start-stop-schedule show

Get the managed instance's Start/Stop schedule.

Core GA
az sql mi start-stop-schedule update

Update the managed instance's Start/Stop schedule.

Core GA
az sql mi stop

Stop the managed instance.

Core GA
az sql mi tde-key

Manage a SQL Instance's encryption protector.

Core GA
az sql mi tde-key set

Sets the SQL Instance's encryption protector.

Core GA
az sql mi tde-key show

Shows a server encryption protector.

Core GA
az sql mi update

Update a managed instance.

Core GA

az sql mi create

Create a managed instance.

az sql mi create --name
                 --resource-group
                 --subnet
                 [--admin-password]
                 [--admin-user]
                 [--am {AzureAD, Paired, Windows}]
                 [--assign-identity]
                 [--backup-storage-redundancy]
                 [--capacity]
                 [--collation]
                 [--database-format {AlwaysUpToDate, SQLServer2022}]
                 [--dns-zone-partner]
                 [--edition]
                 [--enable-ad-only-auth]
                 [--external-admin-name]
                 [--external-admin-principal-type]
                 [--external-admin-sid]
                 [--family]
                 [--gpv2 {false, true}]
                 [--identity-type {None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned}]
                 [--instance-pool-name]
                 [--iops]
                 [--key-id]
                 [--license-type {BasePrice, LicenseIncluded}]
                 [--location]
                 [--maint-config-id]
                 [--minimal-tls-version {1.0, 1.1, 1.2, None}]
                 [--no-wait]
                 [--pid]
                 [--pricing-model {Freemium, Regular}]
                 [--proxy-override {Default, Proxy, Redirect}]
                 [--public-data-endpoint-enabled {false, true}]
                 [--service-principal-type {None, SystemAssigned}]
                 [--storage]
                 [--tags]
                 [--timezone-id]
                 [--user-assigned-identity-id]
                 [--vnet-name]
                 [--yes]
                 [--zone-redundant {false, true}]

Examples

Create a managed instance with minimal set of parameters

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}

Create a managed instance with specified parameters and with identity

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

Create managed instance with specified parameters and tags

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

Create managed instance with specified parameters and backup storage redundancy specified

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 --backup-storage-redundancy Local

Create a managed instance with maintenance configuration

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} -m SQL_{Region}_{MaintenanceConfigName}

Create a managed instance with Service Principal enabled

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} --service-principal-type SystemAssigned

Create a managed instance without SQL Admin, with AAD admin and AD Only enabled

az sql mi create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName --external-admin-sid c5e964e2-6bb2-2222-1111-3b16ec0e1234 -g myResourceGroup -n miName --subnet /subscriptions/78975f9f-2222-1111-1111-29c42ac70000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/ManagedInstance

Create a managed instance without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is SystemAssigned,UserAssigned.

az sql mi create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \ --external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -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 \ --subnet /subscriptions/78975f9f-2222-1111-1111-29c42ac70000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/ManagedInstance

Create a managed instance without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is UserAssigned.

az sql mi create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \ --external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -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 \ --subnet /subscriptions/78975f9f-2222-1111-1111-29c42ac70000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/ManagedInstance

Create managed instance with enabled zone redundancy

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} -z

Create managed instance with zone redundancy explicitly disabled

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} -z false

Create managed instance with instance pool name

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} --instance-pool-name myinstancepool

Create managed instance with database format and pricing model

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} --database-format AlwaysUpToDate --pricing-model Regular

Create managed instance with dns zone partner

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} --dns-zone-partner dns

Create managed instance which uses Windows authentication metadata mode

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} --am Windows

Create GPv2 managed instance with specified IOPS limit

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} -e GeneralPurpose --gpv2 true -f Gen8IH -c 4 --storage 256GB --iops 3000

Required Parameters

--name -n

The managed instance name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subnet

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.

Optional Parameters

--admin-password -p

The administrator login password (required formanaged instance creation).

--admin-user -u

Administrator username for the managed instance. Canonly be specified when the managed instance is beingcreated (and is required for creation).

--am --authentication-metadata

Preferred metadata to use for authentication of synced on-prem users. Default is AzureAD.

Accepted values: AzureAD, Paired, Windows
--assign-identity -i

Generate and assign an Azure Active Directory Identity for this managed instance for use with key management services like Azure KeyVault.

Default value: False
--backup-storage-redundancy --bsr

Backup storage redundancy used to store backups. Allowed values include: Local, Zone, Geo, GeoZone.

--capacity -c

The capacity of the managed instance in integer number of vcores.

--collation

The collation of the managed instance.

--database-format

Managed Instance database format specific to the SQL. Allowed values include: AlwaysUpToDate, SQLServer2022.

Accepted values: AlwaysUpToDate, SQLServer2022
--dns-zone-partner

The resource id of the partner Managed Instance to inherit DnsZone property from for Managed Instance creation.

--edition --tier -e

The edition component of the sku. Allowed values include: GeneralPurpose, BusinessCritical.

--enable-ad-only-auth

Enable Azure Active Directory Only Authentication for this server.

Default value: False
--external-admin-name

Display name of the Azure AD administrator user, group or application.

--external-admin-principal-type

User, Group or Application.

--external-admin-sid

The unique ID of the Azure AD administrator. Object Id for User or Group, Client Id for Applications.

--family -f

The compute generation component of the sku. Allowed values include: Gen4, Gen5.

--gpv2

Whether or not this is a GPv2 variant of General Purpose edition.

Accepted values: false, true
--identity-type -t

Type of Identity to be used. Possible values are SystemAsssigned,UserAssigned, SystemAssignedUserAssigned and None.

Accepted values: None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned
--instance-pool-name

Name of the Instance Pool where managed instance will be placed.

--iops

The storage iops of the managed instance. Storage iops can be specified in increments of 1.

--key-id -k

The key vault URI for encryption.

--license-type

The license type to apply for this managed instance.

Accepted values: BasePrice, LicenseIncluded
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--maint-config-id -m

Assign maintenance configuration to this managed instance.

--minimal-tls-version
Preview

The minimal TLS version enforced by the managed instance for inbound connections.

Accepted values: 1.0, 1.1, 1.2, None
--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--pid --primary-user-assigned-identity-id

The ID of the primary user managed identity.

--pricing-model

Managed Instance pricing model. Allowed values include: Regular, Freemium.

Accepted values: Freemium, Regular
--proxy-override

The connection type used for connecting to the instance.

Accepted values: Default, Proxy, Redirect
--public-data-endpoint-enabled

Whether or not the public data endpoint is enabled for the instance.

Accepted values: false, true
--service-principal-type

Service Principal type to be used for this Managed Instance. Possible values are SystemAssigned and None.

Accepted values: None, SystemAssigned
--storage

The storage size of the managed instance. Storage size must be specified in increments of 32 GB.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--timezone-id

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.

--user-assigned-identity-id -a

Generate and assign an User Managed Identity(UMI) for this server.

--vnet-name

The virtual network name.

--yes -y

Do not prompt for confirmation.

Default value: False
--zone-redundant -z

Specifies whether to enable zone redundancy. Default is true if no value is specified.

Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi delete

Delete a managed instance.

az sql mi delete [--ids]
                 [--name]
                 [--no-wait]
                 [--resource-group]
                 [--subscription]
                 [--yes]

Examples

Delete a managed instance

az sql mi delete -g mygroup -n myinstance --yes

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The managed instance name.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi failover

Failover a managed instance.

az sql mi failover [--ids]
                   [--name]
                   [--no-wait]
                   [--replica-type]
                   [--resource-group]
                   [--subscription]

Examples

Failover a managed instance primary replica

az sql mi failover -g mygroup -n myinstance

Failover a managed instance readable secodary replica

az sql mi failover -g mygroup -n myinstance --replica-type ReadableSecondary

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The managed instance name.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--replica-type

The type of replica to be failed over. Known values are: "Primary" and "ReadableSecondary". Default value is None.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi list

List available managed instances.

az sql mi list [--expand-ad-admin]
               [--resource-group]

Examples

List all managed instances in the current subscription.

az sql mi list

List all managed instances in a resource group.

az sql mi list -g mygroup

Optional Parameters

--expand-ad-admin

Expand the Active Directory Administrator for the server.

Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi refresh-external-governance-status

Refresh external governance enablement status.

az sql mi refresh-external-governance-status [--ids]
                                             [--managed-instance-name]
                                             [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                             [--resource-group]
                                             [--subscription]

Examples

Update external governance status on specific MI

az sql mi refresh-external-governance-status --managed-instance-name managedInstance -g resourceGroup1 --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--managed-instance-name --mi

The name of the managed instance.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

The name of the resource group.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi show

Get the details for a managed instance.

az sql mi show [--expand-ad-admin]
               [--ids]
               [--name]
               [--resource-group]
               [--subscription]

Examples

Get the details for a managed instance

az sql mi show -g mygroup -n myinstance

Optional Parameters

--expand-ad-admin

Expand the Active Directory Administrator for the server.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The managed instance name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi start

Start the managed instance.

az sql mi start [--ids]
                [--managed-instance]
                [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                [--resource-group]
                [--subscription]

Examples

Start a managed instance.

az sql mi start --ids resourceId
az sql mi start --mi miName -g resourceGroup --subscription subscription

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--managed-instance --mi

The name of the managed instance.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of the resource group.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi stop

Stop the managed instance.

az sql mi stop [--ids]
               [--managed-instance]
               [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
               [--resource-group]
               [--subscription]

Examples

Stop a managed instance.

az sql mi stop --ids resourceId
az sql mi stop --mi miName -g resourceGroup --subscription subscription

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--managed-instance --mi

The name of the managed instance.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of the resource group.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql mi update

Update a managed instance.

az sql mi update [--add]
                 [--admin-password]
                 [--am {AzureAD, Paired, Windows}]
                 [--assign-identity]
                 [--backup-storage-redundancy]
                 [--capacity]
                 [--database-format {AlwaysUpToDate, SQLServer2022}]
                 [--edition]
                 [--family]
                 [--force-string]
                 [--gpv2 {false, true}]
                 [--identity-type {None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned}]
                 [--ids]
                 [--instance-pool-name]
                 [--iops]
                 [--key-id]
                 [--license-type {BasePrice, LicenseIncluded}]
                 [--maint-config-id]
                 [--minimal-tls-version {1.0, 1.1, 1.2, None}]
                 [--name]
                 [--no-wait]
                 [--pid]
                 [--pricing-model {Freemium, Regular}]
                 [--proxy-override {Default, Proxy, Redirect}]
                 [--public-data-endpoint-enabled {false, true}]
                 [--remove]
                 [--resource-group]
                 [--service-principal-type {None, SystemAssigned}]
                 [--set]
                 [--storage]
                 [--subnet]
                 [--subscription]
                 [--tags]
                 [--user-assigned-identity-id]
                 [--vnet-name]
                 [--yes]
                 [--zone-redundant {false, true}]

Examples

Updates a mi with specified parameters and with identity

az sql mi update -g mygroup -n myinstance -i -p mypassword --license-type mylicensetype --capacity vcorecapacity --storage storagesize

Update mi edition and hardware family

az sql mi update -g mygroup -n myinstance --tier GeneralPurpose --family Gen5

Add or update a tag.

az sql mi update -g mygroup -n myinstance --set tags.tagName=tagValue

Remove a tag.

az sql mi update -g mygroup -n myinstance --remove tags.tagName

Update a managed instance. (autogenerated)

az sql mi update --name myinstance --proxy-override Default --resource-group mygroup --subscription MySubscription

Update a managed instance. (autogenerated)

az sql mi update --name myinstance --public-data-endpoint-enabled true --resource-group mygroup --subscription MySubscription

Update a managed instance with maintenance configuration

az sql mi update -g mygroup -n myinstance -m SQL_{Region}_{MaintenanceConfigName}

Remove maintenance configuration from managed instance

az sql mi update -g mygroup -n myinstance -m SQL_Default

Update a managed instance with Service Principal

az sql mi update -g mygroup -n myinstance --service-principal-type SystemAssigned

Update a managed instance with User Managed Identies and Identity Type is SystemAssigned,UserAssigned.

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

Update a managed instance with User Managed Identies and Identity Type is UserAssigned

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

Move managed instance to another subnet

az sql mi update -g myResourceGroup -n myServer -i \ --subnet /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet \

Update mi backup storage redundancy

az sql mi update -g mygroup -n myinstance --bsr Local

Enable zone redundancy on a managed instance

az sql mi update -g mygroup -n myinstance -z

Move managed instance to instance pool

az sql mi update -g mygroup -n myinstance --instance-pool-name myinstancepool

Move managed instance out of instance pool

az sql mi update -g mygroup -n myinstance --remove instancePoolId --capacity vcorecapacity

Update mi database format and pricing model

az sql mi update -g mygroup -n myinstance --database-format AlwaysUpToDate --pricing-model Regular

Update managed instance to use Windows authentication metadata mode

az sql mi update -g mygroup -n myinstance --am Windows

Update managed instance to GPv2 with specified IOPS limit

az sql mi update -g mygroup -n myinstance -e GeneralPurpose --gpv2 true --iops 3000

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Default value: []
--admin-password -p

The administrator login password (required formanaged instance creation).

--am --authentication-metadata

Preferred metadata to use for authentication of synced on-prem users. Default is AzureAD.

Accepted values: AzureAD, Paired, Windows
--assign-identity -i

Generate and assign an Azure Active Directory Identity for this managed instance for use with key management services like Azure KeyVault. If identity is already assigned - do nothing.

Default value: False
--backup-storage-redundancy --bsr

Backup storage redundancy used to store backups. Allowed values include: Local, Zone, Geo, GeoZone.

--capacity -c

The capacity of the managed instance in integer number of vcores.

--database-format

Managed Instance database format specific to the SQL. Allowed values include: AlwaysUpToDate, SQLServer2022.

Accepted values: AlwaysUpToDate, SQLServer2022
--edition --tier -e

The edition component of the sku. Allowed values include: GeneralPurpose, BusinessCritical.

--family -f

The compute generation component of the sku. Allowed values include: Gen4, Gen5.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Default value: False
--gpv2

Whether or not this is a GPv2 variant of General Purpose edition.

Accepted values: false, true
--identity-type -t

Type of Identity to be used. Possible values are SystemAsssigned,UserAssigned, SystemAssignedUserAssigned and None.

Accepted values: None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--instance-pool-name

Name of the Instance Pool where managed instance will be placed.

--iops

The storage iops of the managed instance. Storage iops can be specified in increments of 1.

--key-id -k

The key vault URI for encryption.

--license-type

The license type to apply for this managed instance.

Accepted values: BasePrice, LicenseIncluded
--maint-config-id -m

Change maintenance configuration for this managed instance.

--minimal-tls-version
Preview

The minimal TLS version enforced by the managed instance for inbound connections.

Accepted values: 1.0, 1.1, 1.2, None
--name -n

The managed instance name.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--pid --primary-user-assigned-identity-id

The ID of the primary user managed identity.

--pricing-model

Managed Instance pricing model. Allowed values include: Regular, Freemium.

Accepted values: Freemium, Regular
--proxy-override

The connection type used for connecting to the instance.

Accepted values: Default, Proxy, Redirect
--public-data-endpoint-enabled

Whether or not the public data endpoint is enabled for the instance.

Accepted values: false, true
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-principal-type

Service Principal type to be used for this Managed Instance. Possible values are SystemAssigned and None.

Accepted values: None, SystemAssigned
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Default value: []
--storage

The storage size of the managed instance. Storage size must be specified in increments of 32 GB.

--subnet

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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--user-assigned-identity-id -a

Generate and assign an User Managed Identity(UMI) for this server.

--vnet-name

The virtual network name.

--yes -y

Do not prompt for confirmation.

Default value: False
--zone-redundant -z

Specifies whether to enable zone redundancy. Default is true if no value is specified.

Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.