Improve usability of Arc SQL license type policy sample#1476
Open
claestom wants to merge 5 commits intomicrosoft:masterfrom
Open
Improve usability of Arc SQL license type policy sample#1476claestom wants to merge 5 commits intomicrosoft:masterfrom
claestom wants to merge 5 commits intomicrosoft:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 clonewithcurldownloadsUsers no longer need to clone the entire
sql-server-samplesrepository. The README now providescurlcommands 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/cdstep is included for users who want a clean working directory.2. Make
ManagementGroupIdoptional (default: tenant root management group)Both
deployment.ps1andstart-remediation.ps1now defaultManagementGroupIdto the tenant root management group via(Get-AzContext).Tenant.Idwhen 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.mdsamples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/policy/azurepolicy.jsonsamples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/scripts/deployment.ps1samples/manage/azure-arc-enabled-sql-server/compliance/arc-sql-license-type-compliance/scripts/start-remediation.ps1