Skip to content

Commit 4bb742d

Browse files
authored
Merge pull request #108259 from msebolt/powershell-update-pr6
another revision
2 parents 74c03b0 + 3f32bed commit 4bb742d

19 files changed

+228
-313
lines changed

articles/sql-database/scripts/sql-database-add-elastic-pool-to-failover-group-cli.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ If you choose to install and use the CLI locally, this article requires that you
2020

2121
## Sample script
2222

23-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
24-
2523
### Sign in to Azure
2624

25+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
26+
2727
```azurecli-interactive
2828
$subscription = "<subscriptionId>" # add subscription here
2929
@@ -39,17 +39,17 @@ az account set -s $subscription # ...or use 'az login'
3939
Use the following command to remove the resource group and all resources associated with it.
4040

4141
```azurecli-interactive
42-
az group delete --name $resourceGroup
42+
az group delete --name $resource
4343
```
4444

45-
## Script explanation
45+
## Sample reference
4646

47-
This script uses the following commands.
47+
This script uses the following commands. Each command in the table links to command specific documentation.
4848

49-
| Command | Notes |
49+
| | |
5050
|---|---|
51-
| [az sql elastic-pool](/cli/azure/sql/elastic-pool) | Creates an elastic database pool for a an Azure SQL Database. |
52-
| [az sql failover-group ](/cli/azure/sql/failover-group) | Creates a new failover group. |
51+
| [az sql elastic-pool](/cli/azure/sql/elastic-pool) | Elastic pool commands. |
52+
| [az sql failover-group ](/cli/azure/sql/failover-group) | Failover group commands. |
5353

5454
## Next steps
5555

articles/sql-database/scripts/sql-database-add-managed-instance-to-failover-group-cli.md

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,45 @@ ms.date: 07/16/2019
1414
---
1515
# Use CLI to add an Azure SQL Database managed instance to a failover group
1616

17-
This PowerShell script example creates two managed instances, adds them to a failover group, and then tests failover from the primary managed instance to the secondary managed instance.
17+
This Azure CLI example creates two managed instances, adds them to a failover group, and then tests failover from the primary managed instance to the secondary managed instance.
1818

19-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
19+
If you choose to install and use the CLI locally, this article requires that you are running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI](/cli/azure/install-azure-cli).
2020

21-
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
21+
## Sample script
2222

23-
If you choose to install and use the CLI locally, this article requires that you are running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI](/cli/azure/install-azure-cli).
23+
### Sign in to Azure
24+
25+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
2426

25-
## Sample scripts
27+
### Run the script
2628

2729
[!code-azurecli-interactive[main](../../../cli_scripts/sql-database/failover-groups/add-managed-instance-to-failover-group-az-cli.sh "Add managed instance to a failover group")]
2830

29-
## Clean up deployment
31+
### Clean up deployment
3032

3133
Use the following command to remove the resource group and all resources associated with it. You will need to remove the resource group twice. Removing the resource group the first time will remove the managed instance and virtual clusters but will then fail with the error message `az group delete : Long running operation failed with status 'Conflict'.`. Run the az group delete command a second time to remove any residual resources as well as the resource group.
3234

3335
```azurecli-interactive
34-
az group delete --name $resourceGroupName
36+
az group delete --name $resource
3537
```
3638

37-
## Script explanation
39+
## Sample reference
3840

3941
This script uses the following commands. Each command in the table links to command specific documentation.
4042

41-
| Command | Notes |
43+
| | |
4244
|---|---|
43-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
44-
| [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create) | Creates a virtual network. |
45-
| [az network vnet subnet create](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-create) | Adds a subnet configuration to a virtual network. |
46-
| [az network vnet show](/cli/azure/network/vnet#az-network-vnet-show) | Gets a virtual network in a resource group. |
47-
| [az network vnet subnet show](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-show) | Gets a subnet in a virtual network. |
48-
| [az network nsg create](/cli/azure/network/nsg#az-network-nsg-create) | Creates a network security group. |
49-
| [az network route-table create](/cli/azure/network/route-table#az-network-route-table-create) | Creates a route table. |
50-
| [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) | Updates a subnet configuration for a virtual network. |
51-
| [az network vnet update](/cli/azure/network/vnet#az-network-vnet-update) | Updates a virtual network. |
52-
| [az network nsg show](/cli/azure/network/nsg#az-network-nsg-show) | Gets a network security group. |
53-
| [az network nsg rule create](/cli/azure/network/nsg/rule#az-network-nsg-rule-create)| Adds a network security rule configuration to a network security group. |
54-
| [az network nsg rule update](/cli/azure/network/nsg#az-network-nsg-update) | Updates a network security group. |
55-
| [az network route-table route create](/cli/azure/network/route-table/route#az-network-route-table-route-create) | Adds a route to a route table. |
56-
| [az network route-table update](/cli/azure/network/route-table#az-network-route-table-update) | Updates a route table. |
57-
| [az sql mi create](/cli/azure/sql/mi#az-sql-mi-create) | Creates an Azure SQL Database managed instance. |
58-
| [az sql mi show](/cli/azure/sql/mi#az-sql-mi-show)| Returns information about Azure SQL Managed Database Instance. |
59-
| [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create) | Creates a public IP address. |
60-
| [az network vnet-gateway create](/cli/azure/network/vnet-gateway#az-network-vnet-gateway-create) | Creates a Virtual Network Gateway |
61-
| [az sql instance-failover-group create](/cli/azure/sql/instance-failover-group#az-sql-instance-failover-group-create) | Creates a new Azure SQL Database managed instance failover group. |
62-
| [az sql instance-failover-group show](/cli/azure/sql/instance-failover-group#az-sql-instance-failover-group-show) | Gets or lists managed instance failover groups.|
63-
| [az sql instance-failover-group set-primary](/cli/azure/sql/instance-failover-group#az-sql-instance-failover-group-set-primary) | Executes a failover of a managed instance failover group. |
64-
| [az group delete](/cli/azure/vm/extension#az-vm-extension-set) | Deletes a resource group including all nested resources. |
45+
| [az network vnet](/cli/azure/network/vnet) | Virtual network commands. |
46+
| [az network vnet subnet](/cli/azure/network/vnet/subnet) | Virtual network subnet commands. |
47+
| [az network nsg](/cli/azure/network/nsg) | Network security group commands. |
48+
| [az network route-table](/cli/azure/network/route-table) | Route table commands. |
49+
| [az sql mi](/cli/azure/sql/mi) | Managed instance commands. |
50+
| [az network public-ip](/cli/azure/network/public-ip) | Network public IP address commands. |
51+
| [az network vnet-gateway](/cli/azure/network/vnet-gateway) | Virtual Network Gateway commands. |
52+
| [az sql instance-failover-group](/cli/azure/sql/instance-failover-group) | Managed instance failover group commands. |
6553

6654
## Next steps
6755

68-
For more information on the Azure CLI, see [Azure CLI documentation](https://docs.microsoft.com/cli/azure).
56+
For more information on the Azure CLI, see [Azure CLI documentation](/cli/azure).
6957

7058
Additional SQL Database CLI script samples can be found in the [Azure SQL Database documentation](../sql-database-cli-samples.md).

articles/sql-database/scripts/sql-database-add-single-db-to-failover-group-cli.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ ms.author: mathoma
1212
ms.reviewer: carlrab
1313
ms.date: 07/16/2019
1414
---
15-
# Use CLI to add an Azure SQL Database single database into a failover group
15+
# Use CLI to add an Azure SQL Database into a failover group
1616

1717
This Azure CLI script example creates a single database, creates a failover group, adds the database to it, and tests failover.
1818

1919
If you choose to install and use the CLI locally, this topic requires that you are running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI]( /cli/azure/install-azure-cli).
2020

2121
## Sample script
2222

23-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
24-
2523
### Sign in to Azure
2624

25+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
26+
2727
```azurecli-interactive
2828
$subscription = "<subscriptionId>" # add subscription here
2929
@@ -42,14 +42,14 @@ Use the following command to remove the resource group and all resources associa
4242
az group delete --name $resource
4343
```
4444

45-
## Script explanation
45+
## Sample reference
4646

4747
This script uses the following commands. Each command in the table links to command specific documentation.
4848

49-
| Command | Notes |
49+
| | |
5050
|---|---|
51-
| [az sql db](/cli/azure/sql/db) | Creates a database. |
52-
| [az sql failover-group](/cli/azure/sql/failover-group) | Creates a failover group. |
51+
| [az sql db](/cli/azure/sql/db) | Database commands. |
52+
| [az sql failover-group](/cli/azure/sql/failover-group) | Failover group commands. |
5353

5454
## Next steps
5555

articles/sql-database/scripts/sql-database-auditing-and-threat-detection-cli.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ If you choose to install and use the CLI locally, this topic requires that you a
2020

2121
## Sample script
2222

23-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
24-
2523
### Sign in to Azure
2624

25+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
26+
2727
```azurecli-interactive
2828
$subscription = "<subscriptionId>" # add subscription here
2929
@@ -39,14 +39,14 @@ az account set -s $subscription # ...or use 'az login'
3939
Use the following command to remove the resource group and all resources associated with it.
4040

4141
```azurecli-interactive
42-
az group delete --name $resourceGroup
42+
az group delete --name $resource
4343
```
4444

45-
## Script explanation
45+
## Sample reference
4646

4747
This script uses the following commands. Each command in the table links to command specific documentation.
4848

49-
| Command | Notes |
49+
| | |
5050
|---|---|
5151
| [az sql db audit-policy](/cli/azure/sql/db/audit-policy) | Sets the auditing policy for a database. |
5252
| [az sql db threat-policy](/cli/azure/sql/db/threat-policy) | Sets an Advanced Threat Protection policy on a database. |

articles/sql-database/scripts/sql-database-backup-database-cli.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ If you choose to install and use the CLI locally, this article requires that you
1919

2020
## Sample script
2121

22-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
23-
2422
### Sign in to Azure
2523

24+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
25+
2626
```azurecli-interactive
2727
$subscription = "<subscriptionId>" # add subscription here
2828
@@ -38,21 +38,17 @@ az account set -s $subscription # ...or use 'az login'
3838
Use the following command to remove the resource group and all resources associated with it.
3939

4040
```azurecli-interactive
41-
az group delete --name $resourceGroup
41+
az group delete --name $resource
4242
```
4343

44-
## Script explanation
44+
## Sample reference
4545

4646
This script uses the following commands. Each command in the table links to command specific documentation.
4747

4848
| Command | Notes |
4949
|---|---|
50-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
51-
| [az sql server create](/cli/azure/sql/server#az-sql-server-create) | Creates a SQL Database server that hosts single databases and elastic pools. |
52-
| [az sql db show](/cli/azure/sql/db#az-sql-db-show) | Gets a SQL standalone or pooled database. |
53-
| [az sql db restore](/cli/azure/sql/db#az-sql-db-restore) | Restores a SQL standalone or pooled database. |
54-
| [az sql db delete](/cli/azure/sql/db#az-sql-db-delete) | Removes an Azure SQL standalone or pooled database. |
55-
| [az group delete](/cli/azure/vm/extension#az-vm-extension-set) | Deletes a resource group including all nested resources. |
50+
| [az sql server](/cli/azure/sql/server) | Server commands. |
51+
| [az sql db](/cli/azure/sql/db) | Database commands. |
5652

5753
## Next steps
5854

articles/sql-database/scripts/sql-database-copy-database-to-new-server-cli.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ If you choose to install and use the CLI locally, this article requires that you
2020

2121
## Sample script
2222

23-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
24-
2523
### Sign in to Azure
2624

25+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
26+
2727
```azurecli-interactive
2828
$subscription = "<subscriptionId>" # add subscription here
2929
@@ -39,15 +39,15 @@ az account set -s $subscription # ...or use 'az login'
3939
Use the following command to remove the resource group and all resources associated with it.
4040

4141
```azurecli-interactive
42-
az group delete --name $sourceresourcegroupname
43-
az group delete --name $targetresourcegroupname
42+
az group delete --name $resource
43+
az group delete --name $targetResource
4444
```
4545

46-
## Script explanation
46+
## Sample reference
4747

4848
This script uses the following commands. Each command in the table links to command specific documentation.
4949

50-
| Command | Notes |
50+
| | |
5151
|---|---|
5252
| [az sql db copy](/cli/azure/sql/db#az-sql-db-copy) | Creates a copy of a database that uses the snapshot at the current time. |
5353

articles/sql-database/scripts/sql-database-create-and-configure-database-cli.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@ ms.date: 06/25/2019
1616

1717
This Azure CLI script example creates an Azure SQL database and configure a server-level firewall rule. Once the script has been successfully run, the SQL Database can be accessed from all Azure services and the configured IP address.
1818

19-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
20-
21-
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
22-
2319
If you choose to install and use the CLI locally, this topic requires that you are running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI]( /cli/azure/install-azure-cli).
2420

2521
## Sample script
2622

23+
### Sign in to Azure
24+
25+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
26+
27+
### Run the script
28+
2729
[!code-azurecli-interactive[main](../../../cli_scripts/sql-database/create-and-configure-database/create-and-configure-database.sh "Create SQL Database")]
2830

29-
## Clean up deployment
31+
### Clean up deployment
3032

3133
Use the following command to remove the resource group and all resources associated with it.
3234

3335
```azurecli-interactive
34-
az group delete --name $resourceGroupName
36+
az group delete --name $resource
3537
```
3638

37-
## Script explanation
39+
## Sample reference
3840

3941
This script uses the following commands. Each command in the table links to command specific documentation.
4042

41-
| Command | Notes |
43+
| | |
4244
|---|---|
43-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
44-
| [az sql server create](/cli/azure/sql/server#az-sql-server-create) | Creates a SQL Database server that hosts a single database or elastic pool. |
45-
| [az sql server firewall create](/cli/azure/sql/server/firewall-rule#az-sql-server-firewall-rule-create) | Creates a firewall rule to allow access to all single databases an elastic pools on the SQL Database server from the entered IP address range. |
46-
| [az sql db create](/cli/azure/sql/db#az-sql-db-create) | Creates a single database or elastic pool. |
47-
| [az group delete](/cli/azure/resource#az-resource-delete) | Deletes a resource group including all nested resources. |
45+
| [az sql server](/cli/azure/sql/server#az-sql-server-create) | Server commands |
46+
| [az sql server firewall](/cli/azure/sql/server/firewall-rule#az-sql-server-firewall-rule-create) | Server firewall commands. |
47+
| [az sql db](/cli/azure/sql/db#az-sql-db-create) | Database commands. |
4848

4949
## Next steps
5050

51-
For more information on the Azure CLI, see [Azure CLI documentation](https://docs.microsoft.com/cli/azure).
51+
For more information on the Azure CLI, see [Azure CLI documentation](/cli/azure).
5252

5353
Additional SQL Database CLI script samples can be found in the [Azure SQL Database documentation](../sql-database-cli-samples.md).

articles/sql-database/scripts/sql-database-create-configure-managed-instance-cli.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,39 @@ This Azure CLI script example creates an Azure SQL Database managed instance in
1919
> [!IMPORTANT]
2020
> For limitations, see [supported regions](../sql-database-managed-instance-resource-limits.md#supported-regions) and [supported subscription types](../sql-database-managed-instance-resource-limits.md#supported-subscription-types).
2121
22-
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
23-
24-
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
25-
2622
If you choose to install and use the CLI locally, this article requires that you are running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI](/cli/azure/install-azure-cli).
2723

2824
## Sample script
2925

26+
### Sign in to Azure
27+
28+
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
29+
30+
### Run the script
31+
3032
[!code-azurecli-interactive[main](../../../cli_scripts/sql-database/managed-instance/create-managed-instance.sh "Create managed instance")]
3133

32-
## Clean up deployment
34+
### Clean up deployment
3335

3436
Use the following command to remove the resource group and all resources associated with it.
3537

3638
```azurecli-interactive
37-
az group delete --name $resourceGroupName
39+
az group delete --name $resource
3840
```
3941

40-
## Script explanation
42+
## Sample reference
4143

4244
This script uses the following commands. Each command in the table links to command specific documentation.
4345

44-
| Command | Notes |
46+
| | |
4547
|---|---|
46-
| [az group create](/cli/azure/group#az-group-create) | Creates a resource group in which all resources are stored. |
47-
| [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create) | Creates a virtual network. |
48-
| [az network vnet subnet create](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-create) | Adds a subnet configuration to a virtual network. |
49-
| [az network vnet show](/cli/azure/network/vnet#az-network-vnet-show) | Gets a virtual network in a resource group. |
50-
| [az network vnet update](/cli/azure/network/vnet#az-network-vnet-update) | Sets the goal state for a virtual network. |
51-
| [az network vnet subnet show](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-show) | Gets a subnet in a virtual network |
52-
| [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-update) | Configures the goal state for a subnet configuration in a virtual network. |
53-
| [az network route-table create](/cli/azure/network/route-table#az-network-route-table-create) | Creates a route table. |
54-
| [az network route-table show](/cli/azure/network/route-table#az-network-route-table-show) | Gets route tables. |
55-
| [az network route-table update](/cli/azure/network/route-table#az-network-route-table-update) | Sets the goal state for a route table. |
56-
| [az sql mi create](/cli/azure/sql/mi#az-sql-mi-create) | Creates an Azure SQL Database managed instance. |
57-
| [az group delete](/cli/azure/vm/extension#az-vm-extension-set) | Deletes a resource group including all nested resources. |
48+
| [az network vnet](/cli/azure/network/vnet) | Virtual network commands. |
49+
| [az network vnet subnet](/cli/azure/network/vnet/subnet) | Virtual network subnet commands. |
50+
| [az network route-table](/cli/azure/network/route-table) | Network route table commands. |
51+
| [az sql mi](/cli/azure/sql/mi) | Managed instance commands. |
5852

5953
## Next steps
6054

61-
For more information on the Azure CLI, see [Azure CLI documentation](https://docs.microsoft.com/cli/azure).
55+
For more information on the Azure CLI, see [Azure CLI documentation](/cli/azure).
6256

6357
Additional SQL Database CLI script samples can be found in the [Azure SQL Database documentation](../sql-database-cli-samples.md).

0 commit comments

Comments
 (0)