You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/manage/azure-arc-enabled-sql-server/modify-license-type/README.md
+40-11Lines changed: 40 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,12 @@ services: Azure Arc-enabled SQL Server
3
3
platforms: Azure
4
4
author: anosov1960
5
5
ms.author: sashan
6
-
ms.date: 2/09/2023
6
+
ms.date: 2/16/2023
7
7
---
8
8
9
9
10
10
# Overview
11
11
12
-
13
12
This script allows you to to set or change the license type on all Azure-connected SQL Servers
14
13
on a specific resource, in a single resource group, a specific subscription, a list of subscriptions or all subscriptions to which you have access. By default, it sets the specified license type value on the servers where it is undefined. But you can request to set it on all servers in the selected scope.
15
14
@@ -18,10 +17,10 @@ If not specified, all subscriptions your role has access to are scanned.
18
17
19
18
If the license type is not specified, the value "Paid" is used.
20
19
20
+
# Prerequisites
21
21
22
-
# Required permissions
23
-
24
-
You must have at least a *Contributor* role in each subscription you modify.
22
+
- You must have at least a *Contributor* role in each subscription you modify.
23
+
- The Azure extension for SQL Server is updated to version 1.1.2230.58 or newer.
25
24
26
25
# Launching the script
27
26
@@ -32,7 +31,7 @@ The script accepts the following command line parameters:
32
31
|-SubId|subscription_id *or* a file_name|Optional: subscription id or a .csv file with the list of subscriptions<sup>1</sup>. If not specified all subscriptions will be scanned|
33
32
|-ResourceGroup |resource_group_name|Optional: Limit the scope to a specific resource group|
34
33
|-MachineName |machine_name|Optional: Limit the scope to a specific machine|
35
-
|-LicenceType | "Paid" (default), "PAYG" or "LicenseOnly"| Specifies the license type value |
34
+
|-LicenceType | "Paid", "PAYG" or "LicenseOnly"| Required: Specifies the license type value |
36
35
|-All|\$True or \$False (default)|Optional. Set the new license type for all installed extensions. By default the value is set only if license type is undefined.|
37
36
38
37
<sup>1</sup>You can create a .csv file using the following command and then edit to remove the subscriptions you don't want to scan.
The following command will scan all the subscriptions to which the user has access to, and set the license type to "Paid" on all servers where license type is undefined.
46
45
47
46
```PowerShell
48
-
.\update-license-type.ps1 -LicenseType Paid
47
+
.\modify-license-type.ps1 -LicenseType Paid
49
48
```
50
49
51
50
## Example 2
52
51
53
52
The following command will scan the subscription `<sub_id>` and set the license type value to "Paid" on all servers.
The following command will scan resource group <resource_group_name> in the subscription `<sub_id>` and set the license type value to "PAYG" on all servers.
Use the following steps to run the script in Cloud Shell.
68
+
This option is recommended because Cloud shell has the Azure PowerShell modules pre-installed and you are automatically authenticated. Use the following steps to run the script in Cloud Shell.
70
69
71
70
1. Launch the [Cloud Shell](https://shell.azure.com/). For details, [read more about PowerShell in Cloud Shell](https://aka.ms/pscloudshell/docs).
72
71
73
-
2. Upload the script to the shell using the following command:
72
+
2. Upload the script to your cloud shell using the following command:
1. Use the following commands to install the Az module. For more information, see [Install the Azure Az PowerShell module](https://learn.microsoft.com/powershell/azure/install-az-ps):
Install-Module Az -Scope CurrentUser -Repository PSGallery -Force
105
+
```
106
+
107
+
1. Connect to Azure with an authenticated account using an authentication method of your choice. For more information, see [Connect-AzAccount](https://learn.microsoft.com/powershell/module/az.accounts/connect-azaccount).
0 commit comments