-
Notifications
You must be signed in to change notification settings - Fork 739
Support Azure SqlServer role assignments on app specific managed identity #8226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tity Adding role assignment support for PostgreSQL following the pattern set in dotnet#8140 Fix dotnet#6161
There was a problem hiding this 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 adds support for Azure SQL Server role assignments on app-specific managed identities by extending existing resource patterns and updating tests accordingly.
- Introduces a new NameOutputReference and AddRoleAssignments method in AzureSqlServerResource.
- Adjusts the AzureSqlExtensions logic to generate role assignments and outputs the server name.
- Updates tests to verify the new role assignment outputs in generated Bicep manifests.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs | Added role assignment support and a NameOutputReference property for exporting the server name. |
| src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs | Updated resource creation logic and annotation to support role assignments. |
| tests/Aspire.Hosting.Azure.Tests/* | Extended tests to check for server name outputs in the Bicep manifests. |
Comments suppressed due to low confidence (1)
src/Aspire.Hosting.Azure.Sql/AzureSqlServerResource.cs:111
- [nitpick] The variable name 'postgres' is misleading as it represents an SQL Server resource. Consider renaming it to 'sqlServer' for improved clarity.
var postgres = (SqlServer)AddAsExistingResource(infra);
| var resource = new AzureSqlServerResource(name, configureInfrastructure); | ||
| var azureSqlServer = builder.AddResource(resource); | ||
| var azureSqlServer = builder.AddResource(resource) | ||
| .WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>())); | |
| .WithAnnotation(new DefaultRoleAssignmentsAnnotation([])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't because of [API Proposal]: Allow collections expression for other collections (dotnet/runtime#108457). The parameter is of type IReadOnlySet which doesn't support collection expressions.
davidfowl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean
Description
Adding role assignment support for PostgreSQL following the pattern set in #8140
Fix #6161
Checklist