az sql mi

Manage SQL managed instances.

Commands

az sql mi ad-admin

Manage a managed instance's Active Directory administrator.

az sql mi ad-admin create

Creates a new managed instance Active Directory administrator.

az sql mi ad-admin delete

Deletes an existing managed instance Active Directory Administrator.

az sql mi ad-admin list

Returns a list of managed instance Active Directory Administrators.

az sql mi ad-admin update

Updates an existing managed instance Active Directory administrator.

az sql mi create

Create a managed instance.

az sql mi delete

Delete a managed instance.

az sql mi failover

Failover a managed instance.

az sql mi key

Manage a SQL Instance's keys.

az sql mi key create

Creates a SQL Instance key.

az sql mi key delete

Deletes a SQL Instance key.

az sql mi key list

Gets a list of managed instance keys.

az sql mi key show

Shows a SQL Instance key.

az sql mi list

List available managed instances.

az sql mi op

Manage operations on a managed instance.

az sql mi op cancel

Cancels the asynchronous operation on the managed instance.

az sql mi op list

Gets a list of operations performed on the managed instance.

az sql mi op show

Gets a management operation on a managed instance.

az sql mi show

Get the details for a managed instance.

az sql mi tde-key

Manage a SQL Instance's encryption protector.

az sql mi tde-key set

Sets the SQL Instance's encryption protector.

az sql mi tde-key show

Gets a managed instance encryption protector.

az sql mi update

Update a managed instance.

az sql mi create

Create a managed instance.

az sql mi create --admin-password
                 --admin-user
                 --name
                 --resource-group
                 --subnet
                 [--assign-identity]
                 [--backup-storage-redundancy]
                 [--capacity]
                 [--collation]
                 [--edition]
                 [--family]
                 [--license-type {BasePrice, LicenseIncluded}]
                 [--location]
                 [--minimal-tls-version {1.0, 1.1, 1.2, None}]
                 [--no-wait]
                 [--proxy-override {Default, Proxy, Redirect}]
                 [--public-data-endpoint-enabled {false, true}]
                 [--storage]
                 [--subscription]
                 [--tags]
                 [--timezone-id]
                 [--vnet-name]
                 [--yes]

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

Required Parameters

--admin-password -p

The administrator login password (required for managed instance creation).

--admin-user -u

Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).

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

--assign-identity -i

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

--backup-storage-redundancy --bsr

Backup storage redundancy used to store backups.

--capacity -c

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

--collation

The collation of the managed instance.

--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.

--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>.

--minimal-tls-version

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.

--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
--storage

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

--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.

--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.

--vnet-name

The virtual network name.

--yes -y

Do not prompt for confirmation.

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.

--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.

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.

--replica-type

The type of replica to be failed over.

--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.

az sql mi list

List available managed instances.

az sql mi list [--query-examples]
               [--resource-group]
               [--subscription]

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

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--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.

az sql mi show

Get the details for a managed instance.

az sql mi show [--ids]
               [--name]
               [--query-examples]
               [--resource-group]
               [--subscription]

Examples

Get the details for a managed instance

az sql mi show -g mygroup -n myinstance

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.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--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.

az sql mi update

Update a managed instance.

az sql mi update [--add]
                 [--admin-password]
                 [--assign-identity]
                 [--capacity]
                 [--edition]
                 [--family]
                 [--force-string]
                 [--ids]
                 [--license-type {BasePrice, LicenseIncluded}]
                 [--minimal-tls-version {1.0, 1.1, 1.2, None}]
                 [--name]
                 [--no-wait]
                 [--proxy-override {Default, Proxy, Redirect}]
                 [--public-data-endpoint-enabled {false, true}]
                 [--remove]
                 [--resource-group]
                 [--set]
                 [--storage]
                 [--subscription]
                 [--tags]

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

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>.

--admin-password -p

The administrator login password (required for managed instance creation).

--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.

--capacity -c

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

--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.

--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.

--license-type

The license type to apply for this managed instance.

accepted values: BasePrice, LicenseIncluded
--minimal-tls-version

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.

--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 OR --remove propertyToRemove.

--resource-group -g

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

--set

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

--storage

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

--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.