Fix Azure AI Foundry resource name#10934
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where Azure AI Foundry deployment resources were incorrectly using the model name as the resource name in generated Bicep templates. The fix ensures that deployment resources use the proper deployment name instead of the model name, which allows for multiple deployments of the same model with different configurations.
- Fixed deployment resource naming to use the deployment name instead of model name
- Updated connection string generation to properly reference both deployment ID and model name
- Added test coverage for the corrected behavior
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
AzureAIFoundryDeploymentResource.cs |
Changed deployment name assignment from model name to resource name and updated connection string construction |
AzureAIFoundryResource.cs |
Removed redundant connection string helper method |
AzureAIFoundryExtensionsTests.cs |
Added test assertions and additional test case to verify correct deployment naming |
| Bicep snapshot | Updated to reflect correct deployment resource names and added new test deployment |
|
Seems like this shoud be patched in 9.4.2. |
|
@davidfowl I have another one what should go with it IMO, adding tests rn. |
|
Tried it out but didn't deploy (the thing that was being fixed here) |
davidfowl
left a comment
There was a problem hiding this comment.
Make sure you do a full azure deployment before you merge.
|
@sebastienros is this waiting on something? |
|
I did multiple "dashboard deployments" but I assume you want an azd one. |
|
Yep |
|
Before backporting. |
|
/backport to release/9.4 |
|
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/17113491221 |
Description
Currently the generated bicep incorrectly uses the model name as the resource name.
Fixes #10873
Checklist
<remarks />and<code />elements on your triple slash comments?