Muokkaa

Jaa


Deploy a SQL Managed Instance enabled by Azure Arc

Prerequisites

Before you can proceed with the tasks in this article, you need to have the necessary tools. All deployments require the following tools:

  • Azure Data Studio

  • Azure Arc extension for Azure Data Studio

  • Azure CLI (az)

  • arcdata extension for Azure CLI

  • kubectl

    Additional client tools depending your environment. For a more comprehensive list, see Client tools.

In addition to the required tools, to complete the tasks, you need an Azure Arc data controller.

To view available options for the create command for SQL Managed Instance enabled by Azure Arc, use the following command:

az sql mi-arc create --help

To create a SQL Managed Instance enabled by Azure Arc, use az sql mi-arc create. See the following examples for different connectivity modes:

Note

A ReadWriteMany (RWX) capable storage class needs to be specified for backups. Learn more about access modes

If no storage class is specified for backups, the default storage class in Kubernetes is used and if this is not RWX capable, the SQL Managed Instance enabled by Azure Arc installation may not succeed.

az sql mi-arc create --name <name> --resource-group <group> -–subscription <subscription>  --custom-location <custom-location> --storage-class-backups <RWX capable storageclass>

Example:

az sql mi-arc create --name sqldemo --resource-group rg -–subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  --custom-location private-location --storage-class-backups mybackups

Note

Names must be less than 60 characters in length and conform to DNS naming conventions. When specifying memory allocation and vCore allocation use this formula to ensure your performance is acceptable: for each 1 vCore you should have at least 4GB of RAM of capacity available on the Kubernetes node where the SQL Managed Instance enabled by Azure Arc pod will run. If you want to automate the creation of SQL Managed Instance enabled by Azure Arc and avoid the interactive prompt for the admin password, you can set the AZDATA_USERNAME and AZDATA_PASSWORD environment variables to the desired username and password prior to running the az sql mi-arc create command. If you created the data controller using AZDATA_USERNAME and AZDATA_PASSWORD in the same terminal session, then the values for AZDATA_USERNAME and AZDATA_PASSWORD will be used to create the SQL Managed Instance enabled by Azure Arc too.

Note

If you are using the indirect connectivity mode, creating SQL Managed Instance enabled by Azure Arc in Kubernetes will not automatically register the resources in Azure. Steps to register the resource are in the following articles:

View instance on Azure Arc

To view the instance, use the following command:

az sql mi-arc list --k8s-namespace <namespace> --use-k8s

You can copy the external IP and port number from here and connect to SQL Managed Instance enabled by Azure Arc using your favorite tool for connecting to eg. SQL Server or Azure SQL Managed Instance such as Azure Data Studio or SQL Server Management Studio.

At this time, use the insiders build of Azure Data Studio.