-
Couldn't load subscription status.
- Fork 711
Fix missing 'name' property in TableService Bicep generation #10334
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
Co-authored-by: eerhardt <[email protected]>
This doesn't work because of Azure/azure-sdk-for-net#51210. Reverting back to the 9.3 behavior of not creating the bicep resource at all, which is fine for now since we don't have child table resources yet.
|
@copilot - can you fix the tests by following the Snapshot Testing with Verify instructions to run |
|
@copilot - fix the tests by following the "Snapshot Testing with Verify" instructions at https://github.com/dotnet/aspire/blob/main/.github/copilot-instructions.md#snapshot-testing-with-verify. Use |
Co-authored-by: eerhardt <[email protected]>
Fixed by updating test snapshot files with |
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 aims to fix the missing name property in the generated TableService Bicep by removing the previous provisioning implementation and related TableStorageResource references. It also updates test snapshots to no longer expect a table service resource in Bicep output.
- Removed the
ToProvisioningEntitymethod and its import inAzureTableStorageResource - Dropped the
TableStorageResourceproperty and provisioning block inAzureStorageExtensions - Updated snapshots by removing table service resource entries
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Hosting.Azure.Storage/AzureTableStorageResource.cs | Removed ToProvisioningEntity method and unused import |
| src/Aspire.Hosting.Azure.Storage/AzureStorageResource.cs | Removed TableStorageResource property |
| src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs | Removed provisioning logic for table services and TableStorageResource assignment |
| tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureStorageExtensionsTests.*.verified.bicep | Removed expected table service resource entries in snapshots |
Comments suppressed due to low confidence (3)
src/Aspire.Hosting.Azure.Storage/AzureTableStorageResource.cs:42
- Removing the
ToProvisioningEntitymethod prevents generating the TableService resource altogether. Restore this method and ensure it sets theNameproperty to "default" on the provisioning entity.
}
src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs:465
- Removing the assignment of
TableStorageResourceprevents downstream provisioning from detecting the table service. Restore this line so the table resource is registered for provisioning.
var resource = new AzureTableStorageResource(name, builder.Resource);
|
/backport to release/9.4 |
|
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16231014033 |
…otnet#10334)" This reverts commit 059b8ff.
* update azure.provisioning.storage to 1.1.2 * Revert "Fix missing 'name' property in TableService Bicep generation (#10334)" This reverts commit 059b8ff. * Fix tests for latest updates. --------- Co-authored-by: Arcturus Zhang <[email protected]> Co-authored-by: Eric Erhardt <[email protected]>
* update azure.provisioning.storage to 1.1.2 * Revert "Fix missing 'name' property in TableService Bicep generation (#10334)" This reverts commit 059b8ff. * Fix tests for latest updates. --------- Co-authored-by: Eric Erhardt <[email protected]>
When using
AddTableService()on Azure Storage, the generated Bicep was missing the requirednameproperty, resulting in invalid Bicep that fails validation.Problem:
Generated invalid Bicep:
Root cause:
The
AzureTableStorageResource.ToProvisioningEntity()method creates aTableServiceinstance but doesn't set theNameproperty. Unlike BlobService and QueueService which correctly generatename: 'default', TableService was missing this required property.Solution:
Reverted to previous behavior where we don't add a testServices resource to the bicep since we don't have table children (yet).
To fix this for real we need Azure/azure-sdk-for-net#51210
Fixes #10328.