Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Jul 8, 2025

Description

We can't fully remove all our work arounds yet because of Azure/azure-sdk-for-net#51135, but this is a step in the right direction.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

…ovisioning feature

We can't fully remove all our work arounds yet because of Azure/azure-sdk-for-net#51135, but this is a step in the right direction.
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Jul 8, 2025
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

This PR refactors Azure SQL server role assignment to use the new AzurePowerShellScript provisioning feature and updates related tests and Bicep modules.

  • Introduces SqlServerScriptProvisioningResource that extends AzurePowerShellScript
  • Updates AzureSqlServerResource to emit script resources with environment variables
  • Adjusts tests and snapshots to capture the new deployment script resource

Reviewed Changes

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

Show a summary per file
File Description
tests/Aspire.Hosting.Azure.Tests/Snapshots/RoleAssignmentTests.SqlSupport.verified.bicep Adds Bicep snapshot for the new deployment script resource
tests/Aspire.Hosting.Azure.Tests/RoleAssignmentTests.cs Updates SQL support test to include database and reference rename
src/Aspire.Hosting.Azure.Sql/SqlServerScriptProvisioningResource.cs Reworks provisioning class to extend AzurePowerShellScript
src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs Switches to ScriptEnvironmentVariable and new script properties
playground/SqlServerScript/AppHost1/*.bicep Bumps API versions and adds runtime settings in various modules
Comments suppressed due to low confidence (2)

src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs:163

  • Property AzPowerShellVersion does not exist on SqlServerScriptProvisioningResource. The original property was AZPowerShellVersion (or define a new AzPowerShellVersion in the provisioning class).
                AzPowerShellVersion = "10.0"

src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs:173

  • Type ScriptEnvironmentVariable isn’t defined or imported in this project. Either provide its definition or revert to the existing EnvironmentVariable type.
            scriptResource.EnvironmentVariables.Add(new ScriptEnvironmentVariable() { Name = "DBNAME", Value = database });

Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

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

Good change

@eerhardt eerhardt merged commit 6a48b40 into dotnet:main Jul 9, 2025
252 checks passed
@eerhardt eerhardt deleted the UpdateDeploymentScripts branch July 9, 2025 19:06
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants