title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | ms.custom | ms.devlang |
---|---|---|---|---|---|---|---|---|---|---|
Azure CLI example: Create a managed instance |
Use this Azure CLI example script to create a managed instance in Azure SQL Managed Instance. |
urosmil |
urmilano |
mathoma |
02/26/2024 |
sql-managed-instance |
deployment-configuration |
sample |
devx-track-azurecli |
azurecli |
[!INCLUDEappliesto-sqldb]
This Azure CLI script example creates an Azure SQL Managed Instance in a dedicated subnet within a new virtual network. It also configures a route table and a network security group for the virtual network. Once the script has been successfully run, the managed instance can be accessed from within the virtual network or from an on-premises environment. See Configure Azure VM to connect to an Azure SQL Managed Instance and Configure a point-to-site connection to an Azure SQL Managed Instance from on-premises.
Important
For limitations, see supported regions and supported subscription types.
[!INCLUDE quickstarts-free-trial-note]
[!INCLUDE azure-cli-prepare-your-environment.md]
[!INCLUDE cli-run-local-sign-in.md]
:::code language="azurecli" source="~/../azure_cli_scripts/sql-database/managed-instance/create-managed-instance.sh" id="FullScript":::
[!INCLUDE cli-clean-up-resources.md]
az group delete --name $resourceGroup
This script uses the following commands. Each command in the table links to command specific documentation.
Command | Description |
---|---|
az network vnet | Virtual network commands. |
az network vnet subnet | Virtual network subnet commands. |
az network route-table | Network route table commands. |
az sql mi | SQL Managed Instance commands. |
az sql midb | Database commands for SQL Managed Instance. |
For more information on Azure CLI, see Azure CLI documentation.
Other SQL Database CLI script samples can be found in the Azure SQL Database documentation.