az sql midb

Manage SQL managed instance databases.

Commands

az sql midb create Create a managed database.
az sql midb delete Delete a managed database.
az sql midb list List maanged databases on a managed instance.
az sql midb restore Restore a managed database.
az sql midb show Get the details for a managed database.

az sql midb create

Create a managed database.

az sql midb create --managed-instance
--name
--resource-group
[--collation]
[--no-wait]
[--subscription]

Examples

Create a managed database with specified collation

az sql midb create -g mygroup --mi myinstance -n mymanageddb --collation Latin1_General_100_CS_AS_SC

Required Parameters

--managed-instance --mi

Name of the Azure SQL managed instance.

--name -n

The name of the Azure SQL Managed Database.

--resource-group -g

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

Optional Parameters

--collation

The collation of the Azure SQL Managed Database collation to use, e.g.: SQL_Latin1_General_CP1_CI_AS or Latin1_General_100_CS_AS_SC.

--no-wait

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

--subscription

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

az sql midb delete

Delete a managed database.

az sql midb delete [--ids]
[--managed-instance]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
[--yes]

Examples

Delete a managed database

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

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--managed-instance --mi

Name of the Azure SQL managed instance.

--name -n

The name of the Azure SQL Managed Database.

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

List maanged databases on a managed instance.

az sql midb list --managed-instance
--resource-group
[--subscription]

Examples

List managed databases on a managed instance

az sql midb list -g mygroup --mi myinstance

Required Parameters

--managed-instance --mi

Name of the Azure SQL managed instance.

--resource-group -g

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

Optional Parameters

--subscription

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

az sql midb restore

Restore a managed database.

az sql midb restore --dest-name
--time
[--dest-mi]
[--dest-resource-group]
[--ids]
[--managed-instance]
[--name]
[--no-wait]
[--resource-group]
[--subscription]

Examples

Restore a managed database using Point in time restore

az sql midb restore -g mygroup --mi myinstance -n mymanageddb --dest-name targetmidb --time "2018-05-20T05:34:22"

Required Parameters

--dest-name

Name of the managed database that will be created as the restore destination.

--time -t

The point in time of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value. Time should be in following format: "YYYY-MM-DDTHH:MM:SS".

Optional Parameters

--dest-mi

Name of the managed instance to restore managed database to. This can be same managed instance, or another managed instance on same subscription. When not specified it defaults to source managed instance.

--dest-resource-group

Name of the resource group of the managed instance to restore managed database to. When not specified it defaults to source resource group.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--managed-instance --mi

Name of the Azure SQL managed instance.

--name -n

The name of the Azure SQL Managed Database.

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

az sql midb show

Get the details for a managed database.

az sql midb show [--ids]
[--managed-instance]
[--name]
[--resource-group]
[--subscription]

Examples

Get the details for a managed database

az sql midb show -g mygroup --mi myinstance -n mymanageddb

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--managed-instance --mi

Name of the Azure SQL managed instance.

--name -n

The name of the Azure SQL Managed Database.

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