microsoft / microsoft/aspire

Location parameter no longer works in Aspire 9.1 for `AddAzureOpenAI`

Open
#7,831 3 comments 0 reactions 0 assignees View on GitHub
ai area-integrations azure
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Azure OpenAI only supports very specific regions for very specific models, so the ability to pass in a 'location' is quite important, this worked in Aspire 8-9, but no longer with 9.1

```C#

// Add OpenAI
var ai = builder.AddAzureOpenAI("openai")
.AddDeployment(new ("gpt-4o", modelName: "gpt-4o", modelVersion: "2024-08-06"))
.WithParameter(AzureBicepResource.KnownParameters.Location, "northcentralus");

```

After upgrading, I now see:

```
The resource 'openai...' already exists in location 'northcentralus' in resource group '....'. A resource with the same name cannot be created in location 'centralus'. Please select a new resource name.
Status: 409 (Conflict)
ErrorCode: InvalidResourceLocation
```

Where it ignores the 'northcentralus' parameter

### Expected Behavior

The deployment should pass in 'northcentralus', which is the 'known parameter' name for resources

### Steps To Reproduce

Specify a `Location` in your appsettings of 'centralus', then 'northcentralus' for your AzureOpenAI resource in code, as seen above

### Exceptions (if any)

_No response_

### .NET Version info

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.