Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Description

Updates AzPowerShellVersion from "10.0" to "14.0" in AzureSqlServerResource.cs to address Bicep linter warning:

sql-roles.module.bicep(22,1) : Warning use-recent-az-powershell-version:
Deployment script is using AzPowerShell version '10.0' which is below the recommended minimum version '11.0'.
Consider upgrading to version 11.0 or higher to avoid EOL Ubuntu 20.04 LTS.

Changes:

  • Updated AzPowerShellVersion from "10.0" to "14.0" (latest supported version)
  • Added inline comments referencing the linter warning and version rationale
  • Updated snapshot file RoleAssignmentTests.SqlSupport.verified.bicep

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Original prompt

Update the AzPowerShellVersion in src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs from "10.0" to "14.0" (the latest supported version). This addresses the following Bicep linter warning:

sql-roles.module.bicep(22,1) : Warning use-recent-az-powershell-version:
Deployment script is using AzPowerShell version '10.0' which is below the recommended minimum version '11.0'. Consider upgrading to version 11.0 or higher to avoid EOL Ubuntu 20.04 LTS. [https://aka.ms/bicep/linter-diagnostics#use-recent-az-powershell-version]

Also, add a test verifying that AzPowerShellVersion is set to "14.0" in the relevant deployment script/resource generation for AzureSqlServerResource. The test should fail if the version is < 14.0 or not set. Include comments referencing the warning and reason for the version bump.

This pull request was created as a result of the following prompt from Copilot chat.

Update the AzPowerShellVersion in src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs from "10.0" to "14.0" (the latest supported version). This addresses the following Bicep linter warning:

sql-roles.module.bicep(22,1) : Warning use-recent-az-powershell-version:
Deployment script is using AzPowerShell version '10.0' which is below the recommended minimum version '11.0'. Consider upgrading to version 11.0 or higher to avoid EOL Ubuntu 20.04 LTS. [https://aka.ms/bicep/linter-diagnostics#use-recent-az-powershell-version]

Also, add a test verifying that AzPowerShellVersion is set to "14.0" in the relevant deployment script/resource generation for AzureSqlServerResource. The test should fail if the version is < 14.0 or not set. Include comments referencing the warning and reason for the version bump.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update AzPowerShellVersion to 14.0 in AzureSqlServerResource Update AzPowerShellVersion to 14.0 for Azure SQL deployment scripts Dec 3, 2025
Copilot AI requested a review from radical December 3, 2025 04:37
Copilot finished work on behalf of radical December 3, 2025 04:37
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13308

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13308"

/// See: https://aka.ms/bicep/linter-diagnostics#use-recent-az-powershell-version
/// </summary>
[Fact]
public async Task SqlDeploymentScriptUsesAzPowerShellVersion14OrHigher()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this test when we have the above test that baselines the azPowerShellVersion in the bicep file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot drop this new test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the new test in 9b667bb. The existing SqlSupport baseline test already verifies the azPowerShellVersion in the snapshot file.

Copilot finished work on behalf of radical December 4, 2025 21:54
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but it is still in draft. Is that intentional?

@radical radical marked this pull request as ready for review December 4, 2025 23:39
Copilot AI review requested due to automatic review settings December 4, 2025 23:39
@radical
Copy link
Member

radical commented Dec 4, 2025

This looks good, but it is still in draft. Is that intentional?

Fixed it.

Copilot finished reviewing on behalf of radical December 4, 2025 23:41
@radical radical enabled auto-merge (squash) December 4, 2025 23:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

kind: 'AzurePowerShell'
properties: {
azPowerShellVersion: '10.0'
azPowerShellVersion: '14.0'
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The PR description mentions "Also, add a test verifying that AzPowerShellVersion is set to '14.0'" and states that the test should fail if the version is < 14.0 or not set. However, only the snapshot test was updated, and no new explicit test was added.

While the existing snapshot test (RoleAssignmentTests.SqlSupport) will catch changes to the generated Bicep and verify the version is "14.0", consider adding an explicit unit test that directly asserts the AzPowerShellVersion property is set to "14.0" in the AzureSqlServerResource.AddRoleAssignments method. This would make the version requirement more explicit and easier to identify if changed in the future.

For example, you could add a test in AzureSqlExtensionsTests.cs or RoleAssignmentTests.cs that verifies the PowerShell version property directly.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eerhardt thoughts? ^

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.

3 participants