Exercise - Deploy Azure Arc-enabled SQL Managed Instance
To deploy your Azure Arc-enabled SQL Managed Instance, you have several options available:
- GUI deployment:
- Azure portal
- Azure Data Studio
- CLI deployment
- Azure portal Cloud Shell
- Azure Data Studio terminal window
Choose which option you wish to walk through. All exercise options below provide you with the same outcome. All scenarios in the below exercises utilize the General Purpose Tier (Standard Edition). The Business Critical Tier (Enterprise Edition) allows you to choose the number of replicas you require to meet your High Availability needs.
For all exercise options below, the Kubernetes cluster used is an AKS cluster. All options for storage classes used are associated with and supported on an AKS cluster. The Kubernetes cluster implemented in your environment dictates the types of provisioned and presented storage classes. You will need to know your storage classes. The value Default
used for the storage classes below means "use the storage class configured at the AKS cluster level". In this case premium storage.
Option 1: Azure portal GUI deployment
This option is only available with environments configured in the directly connected mode.
In the Azure portal, select + Create resource.
Search for SQL Managed Instance - Azure Arc.
Select Create.
Choose the resource group in which you created your Arc data controller.
Enter a name for your new Arc-enabled SQL Managed Instance.
Choose the custom location associated with your Arc-enabled Kubernetes cluster.
Choose the service type that is associated with your Arc-enabled Kubernetes cluster.
Click Configure compute + storage.
Choose your service tier.
Set the memory request in gigabytes.
Set the memory limit in gigabytes.
Set the CPU vCore request.
Set the CPU vCore limit.
Enter Default for the data storage class.
Set the data volume size in gigabytes.
Enter Default for the datalogs storage class.
Set the datalogs (transaction log files) volume size in gigabytes.
Enter Default for the logs storage class.
Set the logs volume size in gigabytes.
Your backup storage class needs to be ReadWriteMany (RWX) capable.
Set the backup volume size in gigabytes.
Select I already have a SQL Server License if you have Azure Hybrid Benefits.
Click Apply.
Set the admin username for the Arc-enabled SQL Managed Instance.
Set the admin user password for the Arc-enabled SQL Managed Instance.
Select Next: Tags.
Add your appropriate tags.
Select Next: Review + Create
Review your configurations and select Create.
Confirm your Arc-enabled Azure SQL Managed Instance deployment.
In Azure Data Studio, expand the Connection tab. Right-click on your Arc data controller and click refresh. Right-click on your Arc data controller and click manage. You can now manage your Arc-enabled SQL Managed Instance from Azure Data Studio.
Option 2: Azure Data Studio GUI deployment
This option is available with environments configured in either the directly or indirectly connected mode.
In Azure Data Studio, Right-click on your Arc data controller and select Manage.
Select New Instance.
Select Azure SQL Managed Instance.
Review and accept the EULA.
Enter a name for your new Arc-enabled SQL Managed Instance.
Set the Admin username for the Arc-enabled SQL Managed Instance.
Set the Admin user password for the Arc-enabled SQL Managed Instance.
Choose your Service tier.
Select 'I already have a SQL Server License' if you have Azure Hybrid Benefits.
Select Default for the data storage class.
Set the data volume size in gigabytes.
Select Default for the datalogs storage class.
Set the datalogs (transaction log files) volume size in gigabytes.
Select Default for the logs storage class.
Set the logs volume size in gigabytes.
Your backup storage class needs to be ReadWriteMany (RWX) capable.
Set the backup volume size in gigabytes.
Set the CPU vCore request.
Set the CPU vCore limit.
Set the memory request in gigabytes.
Set the memory limit in gigabytes.
Click Deploy.
The deployment opens up a notebook called deploy.sql.existing.arc, which will automatically start executing each of the cells. Once the deployment has completed, refresh the Arc data controller dashboard window.
- Confirm your Arc-enabled Azure SQL Managed Instance deployment.
- In Azure Data Studio, expand the Connection tab. Right-click on your Arc data controller and click refresh. Right-click on your Arc data controller and click manage. You can now manage your Arc-enabled SQL Managed Instance from Azure Data Studio.
Option 3: Azure portal Cloud Shell deployment
This option is only available with environments configured in the directly connected mode.
In the Azure portal open Cloud Shell.
Prepare your Arc-enabled SQL Managed Instance creation parameters:
$Env:MyResourceGroup = 'enter your resource group name here' $Env:MyCluster = 'enter your kubernetes cluster name here' $Env:Mylocation = 'enter your location here' $Env:MyCustomlocation = 'enter your custom location name here' $Env:ServiceTier = 'enter General Purpose or Business Critical here>' $Env:DevUse = 'true' ## only if the evironment is not production $Env:Replicas = '1' ## Values (1,2,3) based on the tier level chosen $Env:SQLLicenseType = 'enter BasePrice or LicenseIncluded' ##based on you having Azure Hybrid Benefits $Env:sql-managed-instanceName = 'enter your arc-enabled sql managed instance name here>' $Env:sql-managed-instanceAdminUser = 'enter your sql mi admin account name here>' $Env:DataStorageClass = 'default' $Env:DataLogsStorageClass = 'default' $Env:LogsStorageClass = 'default' $ENV:BackupsStorageClass = 'azurefile' ## requires to be RWX capable` $Env:BackupRetentionDays = '' $Env:DataVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:DatalogsVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:LogsVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:BackupsVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:CoresRequest = '2' ## Set the number of cores to start with $Env:CoresLimit = '4' ## Set the maximum number of cores $Env:MemoryRequest = '4Gi' ## Set your memory limit appropriately in gigabytes $Env:MemoryLimit = '8Gi' ## Set your maximum memory limit appropriately in gigabytes
Execute the following
az sql mi-arc create
command:az sql mi-arc create --name $Env:sql-managed-instanceName ` --resource-group $Env:MyResourceGroup ` --location $Env:Mylocation ` --custom-location $Env:MyCustomlocation ` --replicas $Env:Replicas ` --cores-request $Env:CoresRequest ` --cores-limit $Env:CoresLimit ` --memory-request $Env:MemoryRequest ` --memory-limit $Env:MemoryLimit ` --storage-class-data $Env:DataStorageClass ` --storage-class-datalogs $Env:DataLogsStorageClass ` --storage-class-logs $Env:LogsStorageClass ` --storage-class-backups $ENV:BackupsStorageClass ` --volume-size-data $Env:DataVolumeSize ` --volume-size-datalogs $Env:DatalogsVolumeSize ` --volume-size-logs $Env:LogsVolumeSize ` --volume-size-backups $Env:BackupsVolumeSize ` --tier $Env:ServiceTier ` --dev ` --license-type $Env:SQLLicenseType ` --cores-limit $Env:CoresLimit
Enter your Arc-enabled SQL Managed Instance admin account and password when prompted.
Confirm your Arc-enabled SQL Managed Instance deployment.
In Azure Data Studio, expand the Connection tab. Right-click on your Arc data controller and click refresh. Right-click on your Arc data controller and click manage. You can now manage your Arc-enabled SQL Managed Instance from Azure Data Studio.
Option 4: Azure Data Studio terminal deployment
This option is available with environments configured in either the directly or indirectly connected mode.
In the Azure portal open Cloud Shell.
Prepare your Arc-enabled SQL Managed Instance creation parameters:
$Env:MyResourceGroup = 'enter your resource group name here' $Env:MyCluster = 'enter your kubernetes cluster name here' $Env:Mylocation = 'enter your location here' $Env:MyCustomlocation = 'enter your custom location name here' $Env:ServiceTier = 'enter General Purpose or Business Critical here>' $Env:DevUse = 'true' ## only if the evironment is not production $Env:Replicas = '1' ## Values (1,2,3) based on the tier level chosen $Env:SQLLicenseType = 'enter BasePrice or LicenseIncluded' ##based on you having Azure Hybrid Benefits $Env:sql-managed-instanceName = 'enter your arc-enabled sql managed instance name here>' $Env:sql-managed-instanceAdminUser = 'enter your sql mi admin account name here>' $Env:DataStorageClass = 'default' $Env:DataLogsStorageClass = 'default' $Env:LogsStorageClass = 'default' $ENV:BackupsStorageClass = 'azurefile' ## requires to be RWX capable` $Env:BackupRetentionDays = '' $Env:DataVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:DatalogsVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:LogsVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:BackupsVolumeSize = '5Gi' ## Adjust your volume size appropriately in gigabytes $Env:CoresRequest = '2' ## Set the number of cores to start with $Env:CoresLimit = '4' ## Set the maximum number of cores $Env:MemoryRequest = '4Gi' ## Set your memory limit appropriately in gigabytes $Env:MemoryLimit = '8Gi' ## Set your maximum memory limit appropriately in gigabytes
Execute the following
az sql mi-arc create
command:az sql mi-arc create --name $Env:sql-managed-instanceName ` --resource-group $Env:MyResourceGroup ` --location $Env:Mylocation ` --custom-location $Env:MyCustomlocation ` --replicas $Env:Replicas ` --cores-request $Env:CoresRequest ` --cores-limit $Env:CoresLimit ` --memory-request $Env:MemoryRequest ` --memory-limit $Env:MemoryLimit ` --storage-class-data $Env:DataStorageClass ` --storage-class-datalogs $Env:DataLogsStorageClass ` --storage-class-logs $Env:LogsStorageClass ` --storage-class-backups $ENV:BackupsStorageClass ` --volume-size-data $Env:DataVolumeSize ` --volume-size-datalogs $Env:DatalogsVolumeSize ` --volume-size-logs $Env:LogsVolumeSize ` --volume-size-backups $Env:BackupsVolumeSize ` --tier $Env:ServiceTier ` --dev ` --license-type $Env:SQLLicenseType ` --cores-limit $Env:CoresLimit
Enter your Arc-enabled SQL Managed Instance admin account and password when prompted.
Confirm your Arc-enabled SQL Managed Instance deployment.
In Azure Data Studio, expand the Connection tab. Right-click on your Arc data controller and click refresh. Right-click on your Arc data controller and click manage. You can now manage your Arc-enabled SQL Managed Instance from Azure Data Studio.