Skip to content

Commit eec1ed4

Browse files
authored
Merge pull request #171169 from jdmartinez36/az-sql-pool-create
1820191: Add Azure CLI instance pool commands where possible
2 parents 737fd3c + e21c04b commit eec1ed4

File tree

1 file changed

+67
-16
lines changed

1 file changed

+67
-16
lines changed

articles/azure-sql/managed-instance/instance-pools-configure.md

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,24 @@ This article provides details on how to create an [instance pool](instance-pools
2020

2121
## Instance pool operations
2222

23-
The following table shows the available operations related to instance pools and their availability in the Azure portal and PowerShell.
24-
25-
|Command|Azure portal|PowerShell|
26-
|:---|:---|:---|
27-
|Create an instance pool|No|Yes|
28-
|Update an instance pool (limited number of properties)|No |Yes |
29-
|Check an instance pool usage and properties|No|Yes |
30-
|Delete an instance pool|No|Yes|
31-
|Create a managed instance inside an instance pool|No|Yes|
32-
|Update resource usage for a managed instance|Yes |Yes|
33-
|Check usage and properties for a managed instance|Yes|Yes|
34-
|Delete a managed instance from the pool|Yes|Yes|
35-
|Create a database in instance within the pool|Yes|Yes|
36-
|Delete a database from SQL Managed Instance|Yes|Yes|
23+
The following table shows the available operations related to instance pools and their availability in the Azure portal, PowerShell, and Azure CLI.
24+
25+
|Command|Azure portal|PowerShell|Azure CLI|
26+
|:---|:---|:---|:---|
27+
|Create an instance pool|No|Yes|Yes|
28+
|Update an instance pool (limited number of properties)|No |Yes | Yes|
29+
|Check an instance pool usage and properties|No|Yes | Yes |
30+
|Delete an instance pool|No|Yes|Yes|
31+
|Create a managed instance inside an instance pool|No|Yes|No|
32+
|Update resource usage for a managed instance|Yes |Yes|No|
33+
|Check usage and properties for a managed instance|Yes|Yes|No|
34+
|Delete a managed instance from the pool|Yes|Yes|No|
35+
|Create a database in instance within the pool|Yes|Yes|No|
36+
|Delete a database from SQL Managed Instance|Yes|Yes|No|
37+
38+
# [PowerShell](#tab/powershell)
39+
40+
To use PowerShell, [install the latest version of PowerShell Core](/powershell/scripting/install/installing-powershell#powershell), and follow instructions to [Install the Azure PowerShell module](/powershell/azure/install-az-ps).
3741

3842
Available [PowerShell commands](/powershell/module/az.sql/):
3943

@@ -45,10 +49,24 @@ Available [PowerShell commands](/powershell/module/az.sql/):
4549
|[Remove-AzSqlInstancePool](/powershell/module/az.sql/remove-azsqlinstancepool/) | Removes an instance pool in SQL Managed Instance. |
4650
|[Get-AzSqlInstancePoolUsage](/powershell/module/az.sql/get-azsqlinstancepoolusage/) | Returns information about SQL Managed Instance pool usage. |
4751

52+
For operations related to instances both inside pools and single instances, use the standard [managed instance commands](api-references-create-manage-instance.md#powershell-create-and-configure-managed-instances), but the *instance pool name* property must be populated when using these commands for an instance in a pool.
4853

49-
To use PowerShell, [install the latest version of PowerShell Core](/powershell/scripting/install/installing-powershell#powershell), and follow instructions to [Install the Azure PowerShell module](/powershell/azure/install-az-ps).
54+
# [Azure CLI](#tab/azure-cli)
5055

51-
For operations related to instances both inside pools and single instances, use the standard [managed instance commands](api-references-create-manage-instance.md#powershell-create-and-configure-managed-instances), but the *instance pool name* property must be populated when using these commands for an instance in a pool.
56+
Prepare your environment for the Azure CLI.
57+
58+
[!INCLUDE [azure-cli-prepare-your-environment-no-header](../../../includes/azure-cli-prepare-your-environment-no-header.md)]
59+
60+
Available [Azure CLI](/cli/azure/sql) commands:
61+
62+
|Cmdlet |Description |
63+
|:---|:---|
64+
|[az sql instance-pool create](/cli/azure/sql/instance-pool#az_sql_instance_pool_create) | Creates a SQL Managed Instance pool. |
65+
|[az sql instance-pool show](/cli/azure/sql/instance-pool#az_sql_instance_pool_show) | Returns information about an instance pool. |
66+
|[az sql instance-pool update](/cli/azure/sql/instance-pool#az_sql_instance_pool_update) | Sets or updates properties for an instance pool in SQL Managed Instance. |
67+
|[az sql instance-pool delete](/cli/azure/sql/instance-pool#az_sql_instance_pool_delete) | Removes an instance pool in SQL Managed Instance. |
68+
69+
---
5270

5371
## Deployment process
5472

@@ -79,6 +97,8 @@ The following restrictions apply to instance pools:
7997
> [!IMPORTANT]
8098
> Deploying an instance pool is a long running operation that takes approximately 4.5 hours.
8199
100+
# [PowerShell](#tab/powershell)
101+
82102
To get network parameters:
83103

84104
```powershell
@@ -100,6 +120,37 @@ $instancePool = New-AzSqlInstancePool `
100120
-Location "westeurope"
101121
```
102122

123+
# [Azure CLI](#tab/azure-cli)
124+
125+
To get the virtual network parameters:
126+
127+
```azurecli
128+
az network vnet show --resource-group MyResourceGroup --name miPoolVirtualNetwork
129+
```
130+
131+
To get the virtual subnet parameters:
132+
133+
```azurecli
134+
az network vnet subnet show --resource group MyResourceGroup --name miPoolSubnet --vnet-name miPoolVirtualNetwork
135+
```
136+
137+
To create an instance pool:
138+
139+
```azurecli
140+
az sql instance-pool create
141+
--license-type LicenseIncluded
142+
--location westeurope
143+
--name mi-pool-name
144+
--capacity 8
145+
--tier GeneralPurpose
146+
--family Gen5
147+
--resrouce-group myResourceGroup
148+
--subnet miPoolSubnet
149+
--vnet-name miPoolVirtualNetwork
150+
```
151+
152+
---
153+
103154
> [!IMPORTANT]
104155
> Because deploying an instance pool is a long running operation, you need to wait until it completes before running any of the following steps in this article.
105156

0 commit comments

Comments
 (0)