Skip to content

Fix Azure AI Foundry resource name#10934

Merged
sebastienros merged 4 commits intomainfrom
sebros/aifoundry
Aug 21, 2025
Merged

Fix Azure AI Foundry resource name#10934
sebastienros merged 4 commits intomainfrom
sebros/aifoundry

Conversation

@sebastienros
Copy link
Member

Description

Currently the generated bicep incorrectly uses the model name as the resource name.

Fixes #10873

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Copilot AI review requested due to automatic review settings August 12, 2025 18:30
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Aug 12, 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 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

@davidfowl
Copy link
Member

Seems like this shoud be patched in 9.4.2.

@sebastienros
Copy link
Member Author

@davidfowl I have another one what should go with it IMO, adding tests rn.

@davidfowl
Copy link
Member

Tried it out but didn't deploy (the thing that was being fixed here)

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.

Make sure you do a full azure deployment before you merge.

@davidfowl
Copy link
Member

@sebastienros is this waiting on something?

@sebastienros
Copy link
Member Author

I did multiple "dashboard deployments" but I assume you want an azd one.

@davidfowl
Copy link
Member

Yep

@davidfowl
Copy link
Member

Before backporting.

@sebastienros sebastienros merged commit 7f35c8c into main Aug 21, 2025
292 checks passed
@sebastienros sebastienros deleted the sebros/aifoundry branch August 21, 2025 00:12
@dotnet-policy-service dotnet-policy-service bot added this to the 9.5 milestone Aug 21, 2025
@sebastienros
Copy link
Member Author

/backport to release/9.4

@github-actions
Copy link
Contributor

Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/17113491221

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 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.

AI Foundry: Model name not picked up

3 participants