Skip to content

Improve usability of Arc SQL license type policy sample#1476

Open
claestom wants to merge 5 commits intomicrosoft:masterfrom
claestom:sql-arc-lt-policy-v2
Open

Improve usability of Arc SQL license type policy sample#1476
claestom wants to merge 5 commits intomicrosoft:masterfrom
claestom:sql-arc-lt-policy-v2

Conversation

@claestom
Copy link
Copy Markdown
Contributor

@claestom claestom commented Apr 4, 2026

Improve usability of Arc SQL license type policy sample

Follow-up improvements to the Arc-enabled SQL Server license type policy sample introduced in #1475. These changes reduce friction for users deploying the policy.

Changes

1. Replace git clone with curl downloads

Users no longer need to clone the entire sql-server-samples repository. The README now provides curl commands that download only the three required files (policy/azurepolicy.json, scripts/deployment.ps1, scripts/start-remediation.ps1) into the expected folder structure.

An optional mkdir sql-arc-lt-compliance / cd step is included for users who want a clean working directory.

2. Make ManagementGroupId optional (default: tenant root management group)

Both deployment.ps1 and start-remediation.ps1 now default ManagementGroupId to the tenant root management group via (Get-AzContext).Tenant.Id when not specified. Users can still pass an explicit value to target a different scope.

3. Make policy display names and descriptions generic

The policy definition (azurepolicy.json) and assignment display names no longer hardcode a specific license type (e.g., "License With Software Assurance"). They now use generic wording — "Configure Arc-enabled SQL Server license type" — since the actual target is controlled by parameters at assignment time.

Files changed

  • samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/README.md
  • samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/policy/azurepolicy.json
  • samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/scripts/deployment.ps1
  • samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/scripts/start-remediation.ps1

claestom added 5 commits April 4, 2026 16:27
Remove the full-repo git clone instruction and replace it with
targeted curl commands that download only the three required files
(policy/azurepolicy.json, scripts/deployment.ps1, scripts/start-remediation.ps1).

This avoids cloning the entire sql-server-samples repository, reducing
setup time and bandwidth for users who only need the Arc SQL license
type policy.

Changes:
- Add optional mkdir/cd step for a clean local working directory
- Add curl commands to fetch individual files into the expected
  policy/ and scripts/ folder structure
- Add note about curl alias on Windows PowerShell 5.1
- Remove git clone and deep cd instructions

No script changes required: deployment.ps1 resolves the policy JSON
via Join-Path relative to PSScriptRoot, which is preserved by the
new folder layout.
Change ManagementGroupId from required to optional in both
deployment.ps1 and start-remediation.ps1. When not specified,
the scripts resolve the tenant root management group ID
automatically via (Get-AzContext).Tenant.Id.

Changes:
- deployment.ps1: ManagementGroupId parameter now Mandatory=false;
  auto-resolves to tenant root group with informational output
- start-remediation.ps1: same parameter change and auto-resolve
- README.md: updated both parameter tables (Required=No, default
  shown as 'Tenant root group'); simplified examples to omit
  ManagementGroupId where the default suffices; added explicit
  management group examples for users who need a custom scope
Remove hardcoded license type references from policy displayName
and description. The actual target license type is controlled by
parameters at assignment time, so the definition metadata should
not imply a specific value.

Changes:
- azurepolicy.json: displayName and description now use generic
  'Configure Arc-enabled SQL Server license type' wording
- deployment.ps1: collapsed the PAYG/SA conditional display name
  logic into a single generic label per platform
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.
Restructure both Deploy Policy and Start Remediation usage
instructions to guide users through setting variables before
running scripts. Clearly separates required vs optional parameters
with inline comments, shows progressively detailed invocations
(minimal, with subscription, with all options), and streamlines
scenario examples with descriptive comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant