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
This Azure Policy ensures that all SQL Arc servers using `LicenseType = Paid` are marked as non-compliant. Servers with `LicenseType = LicenseOnly` are treated as compliant. The remediation task sets `LicenseType = PAYG`.
4
+
5
+
Use Azure CLI or PowerShell to create the policy definition:
6
+
7
+
## Artifacts
8
+
9
+
-**policy.json**: Main policy definition referencing external parameter and rule files.
--description "This Azure Policy ensures that all SQL Arc servers using LicenseType = Paid are marked as non-compliant. Servers with LicenseType = LicenseOnly are treated as compliant. The remediation task sets LicenseType = PAYG." `
35
+
--rules "@rules.json" `
36
+
--params "@params.json" `
37
+
--mode Indexed `
38
+
--subscription $SubId `
39
+
--only-show-errors | Out-Null
40
+
```
41
+
42
+
## Assign policy
43
+
44
+
Use the following command to assign policy
45
+
46
+
```PowerShell
47
+
48
+
$SubId = "<your-subscription-id>"
49
+
$RgName = "<your-resource-group>" # optional; set to "" to target subscription scope
--description "This Azure Policy ensures that all SQL Managed Instance resources using LicenseType = BasePrice are marked as non-compliant. The remediation task sets LicenseType = LicenseIncluded." \
24
-
--rules @rules.json \
25
-
--params @params.json \
26
-
--mode Indexed \
27
-
--subscription "<your-subscription-id>"\
31
+
az policy definition create `
32
+
--name $PolicyName `
33
+
--display-name $PolicyName `
34
+
--description "This Azure Policy ensures that all SQL Managed Instance resources using LicenseType = BasePrice are marked as non-compliant. The remediation task sets LicenseType = LicenseIncluded" `
0 commit comments