Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.63k stars 3.77k forks source link

Deployment failed using existing OpenAI resource (also see #61) #75

Open kevintupper opened 1 year ago

kevintupper commented 1 year ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Follow the document and use existing OpenAI resource instead of creating new:

SUCCESS: New project initialized! You can view the template code in your directory: C:\src\uscg Learn more about running 3rd party code on our DevHub: https://learn.microsoft.com/azure/developer/azure-developer-cli/azd-templates#guidelines-for-using-azd-templates PS C:\src\uscg> azd env set AZURE_OPENAI_SERVICE demo-openai PS C:\src\uscg> azd env set AZURE_OPENAI_RESOURCE_GROUP demo PS C:\src\uscg> azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-35-turbo PS C:\src\uscg> azd env set AZURE_OPENAI_GPT_DEPLOYMENT text-davinci-003 PS C:\src\uscg> azd up

Per existing bug report, I also added the following to /infra/main.parameters.json

"openAiResourceGroupLocation": {
  "value": "eastus"
}

Any log messages given by the failure

Initializing a new project (azd init)

Provisioning Azure resources (azd provision) Provisioning Azure resources can take some time

You can view detailed progress in the Azure Portal: https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2Fd47760dc-cfac-4bc4-992a-d28135b3df3a%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fuscg

(✓) Done: Resource group: rg-uscg (✓) Done: Storage account: st6yvb6xqgquhis (✓) Done: App Service plan: plan-6yvb6xqgquhis

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details: DuplicatedDeploymentForSameModel: The deployment 'davinci' has the same model with an existing deployment 'text-davinci-003'. Only 1 deployment is allowed for the same model.

| | Creating/Updating resources

Expected/desired behavior

Use the existing resource I defined in the env and continue deploying.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

erikcvisser commented 1 year ago

Seems like your OpenAI resource already has a deployment for the davinci model. Did you try creating a new OpenAI resource or removing the davinci model in it?

raffertyuy commented 1 year ago

I got the same issue! I believe it's because the deployment names are hardcoded in main.bicep

param gptDeploymentName string = 'davinci'
param gptModelName string = 'text-davinci-003'
param chatGptDeploymentName string = 'chat'
param chatGptModelName string = 'gpt-35-turbo'

I deployed using a new azure openai resource for now as a workaround, until this is fixed.

hophanms commented 1 year ago

I ran into same issue. Doesn't seem like azd env set AZURE_OPENAI_SERVICE would take the value arg.

fms-santos commented 1 year ago

I'm running into the same issue when redeploying my app

simara commented 1 year ago

Changed the hardcoded services in main.bicep to my own and deployment worked.

rachaelsingleton commented 1 year ago

Same issue, my env variables aren't being used.

ericthomas1 commented 1 year ago

Thanks @simara,

Had to change this in main.bicep:

param gptDeploymentName string = 'davinci'
param gptModelName string = 'text-davinci-003'
param chatGptDeploymentName string = '<my-existing-gpt-3.5-model>'
param chatGptModelName string = 'gpt-35-turbo'

I'm imagining this affects a lot of people.

saisamarthtaluri commented 10 months ago

I have set param chatGptDeploymentName string = '<my deployment name>' , but it still tries to create new openai resource. I do not have permissions to create new openai resource but can only use an existing one.

pamelafox commented 10 months ago

@saisamarthtaluri Yeah we need to account for that better, can you try deleting the whole openai resource definition in main.bicep? Starting at line 145:

https://github.com/Azure-Samples/azure-search-openai-demo/blob/424c8d84a36d8c245cba5259b4f920f8e7893ea4/infra/main.bicep#L145

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.