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
+27-14Lines changed: 27 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ services: Azure Arc-enabled SQL Server
3
3
platforms: Azure
4
4
author: anosov1960
5
5
ms.author: sashan
6
-
ms.date: 12/01/2024
6
+
ms.date: 05/01/2025
7
7
---
8
8
9
9
@@ -16,42 +16,45 @@ If not specified, all subscriptions your role has access to are scanned.
16
16
17
17
# Prerequisites
18
18
19
-
- You must have at least *Azure Connected Machine Resource Administrator* role and subscription *Reader* role.
19
+
- You must have at least a *Azure Connected Machine Resource Administrator* role in each subscription you modify.
20
20
- The Azure extension for SQL Server is updated to version 1.1.2230.58 or newer.
21
21
- You must be connected to Azure AD and logged in to your Azure account. If your account have access to multiple tenants, make sure to log in with a specific tenant ID.
22
22
23
+
23
24
# Launching the script
24
25
25
26
The script accepts the following command line parameters:
|-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|
30
-
|-ResourceGroup |resource_group_name|Optional: Limits the scope to a specific resource group|
31
-
|-MachineName |machine_name|Optional: Limits the scope to a specific machine|
32
-
|-LicenseType | "Paid", "PAYG" or "LicenseOnly"| Optional: Sets the license type to the specified value |
33
-
|-UsePcoreLicense | "Yes", "No" | Optional. Enables unlimited virtualization license if the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
34
-
|-EnableESU | "Yes", "No" | Optional. Enables the ESU policy the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
35
-
|-Force||Optional. Forces the change of the license type to the specified value on all installed extensions. If -Force is not specified, the -LicenseType value is set only if undefined. Ignored if -LicenseType is not specified|
30
+
|`-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|
31
+
|`-ResourceGroup`|resource_group_name|*Optional*: Limits the scope to a specific resource group|
32
+
|`-MachineName`|machine_name|*Optional*: Limits the scope to a specific machine|
33
+
|`-LicenseType`| "Paid", "PAYG" or "LicenseOnly"|*Optional*: Sets the license type to the specified value |
34
+
|`-ConsentToRecurringPAYG`| "Yes" or "No" |*Optional*. Consents to enabling the recurring PAYG billing. LicenseType must be "PAYG". Applies to CSP subscriptions only.|
35
+
|`-UsePcoreLicense`| "Yes", "No" |*Optional*. Enables unlimited virtualization license if the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
36
+
|`-EnableESU`| "Yes", "No" |*Optional*. Enables the ESU policy the value is "Yes" or disables it if the value is "No". To enable, the license type must be "Paid" or "PAYG"|
37
+
|`-Force`||*Optional*. Forces the change of the license type to the specified value on all installed extensions. If `-Force` is not specified, the `-LicenseType` value is set only if undefined. Ignored if `-LicenseType` is not specified|
36
38
37
39
<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 "PAYG" on all servers where license type is undefined.
46
+
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.
44
47
45
48
```PowerShell
46
-
.\modify-license-type.ps1 -LicenseType PAYG
49
+
.\modify-license-type.ps1 -LicenseType Paid
47
50
```
48
51
49
52
## Example 2
50
53
51
-
The following command will scan all all the subscriptions to which the user has access to, and set the license type to "PAYG" on all servers.
54
+
The following command will scan the subscription `<sub_id>`and set the license type value to "Paid" on all servers.
@@ -64,7 +67,7 @@ The following command will scan resource group `<resource_group_name>` in the su
64
67
65
68
## Example 4
66
69
67
-
The following command will set License Type to 'Paid" and enables ESU on all servers in the subscriptions `<sub_id>` and the resource group `<resource_group_name>`.
70
+
The following command will set License Type to "Paid" and enables ESU on all servers in the subscriptions `<sub_id>` and the resource group `<resource_group_name>`.
@@ -78,6 +81,16 @@ The following command will disable ESU on all servers in the subscriptions `<sub
78
81
.\modify-license-type.ps1 -SubId <sub_id> -EnableESU No
79
82
```
80
83
84
+
## Example 6
85
+
86
+
The following command will scan all subscriptions in the account, set the license type value to "PAYG" and consents to enabling recurring billing on all servers in the account.
> The recurring billing only supported in the CSP accounts.
93
+
81
94
# Running the script using Cloud Shell
82
95
83
96
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.
Copy file name to clipboardExpand all lines: samples/manage/azure-arc-enabled-sql-server/modify-license-type/modify-license-type.ps1
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@
12
12
# -ResourceGroup [resource_goup] (Optional. Limits the scope to a specific resoure group)
13
13
# -MachineName [machine_name] (Optional. Limits the scope to a specific machine)
14
14
# -LicenseType [license_type_value] (Optional. Sets the license type to the specified value)
15
+
# -ConsentToRecurringPAYG [Yes or No] (Optional. Consents to enabling the recurring PAYG billing. LicenseType must be "PAYG". Applies to CSP subscriptions only.
15
16
# -UsePcoreLicense [Yes or No] (Optional. Enables unlimited virtualization license if the value is "Yes" or disables it if the value is "No"
16
17
# To enable, the license type must be "Paid" or "PAYG"
17
18
# -EnableESU [Yes or No] (Optional. Enables the ESU policy if the value is "Yes" or disables it if the value is "No"
0 commit comments