Skip to content

Commit 868cc27

Browse files
committed
Add dynamic license type label to policy display names
Include the selected target license type in the policy definition and assignment display names for clarity in the Azure Portal. Format: Configure Arc-enabled SQL Server (<platform>) license type to '<label>' Examples: - Configure Arc-enabled SQL Server (All platforms) license type to 'Pay-as-you-go' - Configure Arc-enabled SQL Server (Linux) license type to 'License With Software Assurance' The azurepolicy.json description remains generic since the display name is overridden by the script at definition creation time.
1 parent 546847b commit 868cc27

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/scripts

samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/scripts/deployment.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ else {
6060
$PolicyDefinitionName = "activate-sql-arc-$LicenseToken-$PlatformToken"
6161
$PolicyAssignmentName = "sql-arc-$LicenseToken-$PlatformToken"
6262

63-
$PolicyDefinitionDisplayName = "Configure Arc-enabled SQL Server ($PlatformLabel) license type"
64-
$PolicyAssignmentDisplayName = "Configure Arc-enabled SQL Server ($PlatformLabel) license type"
63+
$LicenseTypeLabel = if ($TargetLicenseType -eq 'PAYG') { 'Pay-as-you-go' } else { 'License With Software Assurance' }
64+
$PolicyDefinitionDisplayName = "Configure Arc-enabled SQL Server ($PlatformLabel) license type to '$LicenseTypeLabel'"
65+
$PolicyAssignmentDisplayName = "Configure Arc-enabled SQL Server ($PlatformLabel) license type to '$LicenseTypeLabel'"
6566

6667
#Create policy definition
6768
New-AzPolicyDefinition `

0 commit comments

Comments
 (0)