Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 18, 2025

Summary

Updates all provisioning scripts to pin the SqlServer PowerShell module to version 22.3.0 to avoid breaking changes introduced in version 22.4.5.1.

Problem

The current provisioning scripts use:

Install-Module -Name SqlServer -Force -AllowClobber -Scope CurrentUser

This installs the latest version of the SqlServer module, which can include breaking changes. Version 22.4.5.1 introduced breaking changes that affect the deployment scripts.

Solution

Changed all instances to specify the last known working version:

# Install SqlServer module - using specific version to avoid breaking changes in 22.4.5.1 (see https://github.com/dotnet/aspire/issues/9926)
Install-Module -Name SqlServer -RequiredVersion 22.3.0 -Force -AllowClobber -Scope CurrentUser

Files Changed

  • Source template: src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs - Updated the PowerShell script template
  • Bicep modules: Updated 6 Bicep files containing embedded PowerShell scripts:
    • playground/SqlServerScript/AppHost1/api1-roles-mysqlserver.module.bicep
    • playground/SqlServerScript/AppHost1/api2-roles-mysqlserver.module.bicep
    • playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql1-roles.module.bicep
    • playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql2-roles.module.bicep
    • playground/bicep/BicepSample.AppHost/sql-roles.module.bicep
    • playground/cdk/CdkSample.AppHost/sql-roles.module.bicep

Testing

  • ✅ All Bicep files compile successfully with az bicep build
  • ✅ C# project builds without errors
  • ✅ All changes are minimal (1-2 lines per file)

Fixes #9926

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: bicep build playground/SqlServerScript/AppHost1/api1-roles-mysqlserver.module.bicep --stdout (dns block)
    • Triggering command: bicep build playground/bicep/BicepSample.AppHost/sql-roles.module.bicep --stdout (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Pin SqlServer PowerShell module version in provisioning script to workaround 22.4.5.1 issue (#9926) Fix SqlServer PowerShell module version to avoid breaking changes in 22.4.5.1 Jun 18, 2025
Copilot finished work on behalf of sebastienros June 18, 2025 18:27
Copilot AI requested a review from sebastienros June 18, 2025 18:27
@sebastienros
Copy link
Member

@copilot the correct version to use is 22.3.0

Copy link
Contributor Author

Copilot AI commented Jun 18, 2025

@copilot the correct version to use is 22.3.0

Updated all files to use version 22.3.0 as requested. Commit b75c670

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: bicep build playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql1-roles.module.bicep --stdout (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of sebastienros June 18, 2025 18:38
@sebastienros sebastienros marked this pull request as ready for review June 18, 2025 18:39
Copilot AI review requested due to automatic review settings June 18, 2025 18:39
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.

Pull Request Overview

Pins the SqlServer PowerShell module to a specific known-good version across all provisioning scripts to prevent breaking changes from version 22.4.5.1.

  • Updated the C# provisioning template to install SqlServer module at a fixed version.
  • Updated six deployment script modules (Bicep & CDK) to use the same pinned version.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs Pin Install-Module to a specific RequiredVersion
playground/cdk/CdkSample.AppHost/sql-roles.module.bicep Pin SqlServer module version in scriptContent
playground/bicep/BicepSample.AppHost/sql-roles.module.bicep Pin SqlServer module version in scriptContent
playground/SqlServerScript/AppHost1/api2-roles-mysqlserver.module.bicep Pin SqlServer module version in scriptContent
playground/SqlServerScript/AppHost1/api1-roles-mysqlserver.module.bicep Pin SqlServer module version in scriptContent
playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql2-roles.module.bicep Pin SqlServer module version in scriptContent
playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql1-roles.module.bicep Pin SqlServer module version in scriptContent

@sebastienros
Copy link
Member

Verified successfully. Tested before and after the fix.

@sebastienros
Copy link
Member

/backport to release/9.3

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@sebastienros backporting to "release/9.3" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Creating an empty commit: Initial plan for issue
Applying: Fix SqlServer PowerShell module version to avoid breaking changes
Using index info to reconstruct a base tree...
M	playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql1-roles.module.bicep
M	playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql2-roles.module.bicep
M	playground/bicep/BicepSample.AppHost/sql-roles.module.bicep
M	playground/cdk/CdkSample.AppHost/sql-roles.module.bicep
M	src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs
Auto-merging playground/cdk/CdkSample.AppHost/sql-roles.module.bicep
CONFLICT (content): Merge conflict in playground/cdk/CdkSample.AppHost/sql-roles.module.bicep
Auto-merging playground/bicep/BicepSample.AppHost/sql-roles.module.bicep
CONFLICT (content): Merge conflict in playground/bicep/BicepSample.AppHost/sql-roles.module.bicep
Auto-merging playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql2-roles.module.bicep
Auto-merging playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/sql1-roles.module.bicep
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Fix SqlServer PowerShell module version to avoid breaking changes
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@davidfowl davidfowl merged commit 60f9903 into main Jun 19, 2025
252 checks passed
@davidfowl davidfowl deleted the copilot/fix-ccd8d69a-8184-48dd-a76d-b6a1ff0460b0 branch June 19, 2025 05:03
captainsafia pushed a commit that referenced this pull request Jun 20, 2025
…22.4.5.1 (#9939)

* Initial plan for issue

* Fix SqlServer PowerShell module version to avoid breaking changes

Co-authored-by: sebastienros <[email protected]>

* Update SqlServer PowerShell module version to 22.3.0 as requested

Co-authored-by: sebastienros <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: sebastienros <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure Sql Provisioning Stopped Working

3 participants