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
> If you are setting License type to "PAYG" in the CSP subscription(s), the subscription resource must have a consent tag enabling perpetual pay-as-you-go billing. Without the tag, the command will fail. The consent tag is `SQLPerpetualPaygBilling`:`Enabled` and can be added using [Azure portal](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources-portal), [PowerShell](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources-powershell) or [CLI](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources-cli).
43
-
44
41
## Example 1
45
42
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.
43
+
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.
if ($tags.Tags.ContainsKey("SQLPerpetualPaygBilling")) {
148
-
if ($tags.Tags["SQLPerpetualPaygBilling"] -ne"Enabled") {
149
-
write-host"Error: Subscription $($sub.Id) has an incorrect value $($tags.Tags["SQLPerpetualPaygBilling"]) of the consent tag 'SQLPerpetualPaygBilling' ."
150
-
continue
151
-
}
152
-
} else {
153
-
write-host"Error: Subscription $($sub.Id) does not have the consent tag 'SQLPerpetualPaygBilling'."
154
-
continue
155
-
}
156
-
}
157
-
}
158
-
159
182
$query="
160
183
resources
161
184
| where type =~ 'microsoft.hybridcompute/machines/extensions'
@@ -180,6 +203,7 @@ foreach ($sub in $subscriptions) {
180
203
181
204
$resources=Search-AzGraph-Query "$($query)"
182
205
foreach ($rin$resources) {
206
+
183
207
$setID=@{
184
208
MachineName=$r.MachineName
185
209
Name=$r.extensionName
@@ -194,6 +218,7 @@ foreach ($sub in $subscriptions) {
0 commit comments