Update AzureSqlServerResource to use the new AzurePowerShellScript provisioning feature#10290
Merged
eerhardt merged 2 commits intomicrosoft:mainfrom Jul 9, 2025
Merged
Conversation
…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.
Contributor
There was a problem hiding this comment.
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
SqlServerScriptProvisioningResourcethat extendsAzurePowerShellScript - Updates
AzureSqlServerResourceto 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
AzPowerShellVersiondoes not exist onSqlServerScriptProvisioningResource. The original property wasAZPowerShellVersion(or define a newAzPowerShellVersionin the provisioning class).
AzPowerShellVersion = "10.0"
src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs:173
- Type
ScriptEnvironmentVariableisn’t defined or imported in this project. Either provide its definition or revert to the existingEnvironmentVariabletype.
scriptResource.EnvironmentVariables.Add(new ScriptEnvironmentVariable() { Name = "DBNAME", Value = database });
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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