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
6.32k stars 4.22k forks source link

Can't deploy to existing search service with free sku #586

Closed KellyChesco closed 12 months ago

KellyChesco 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

azd env set AZURE_SEARCH_SERVICE chesco-cog-search azd up

Any log messages given by the failure

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: InvalidTemplateDeployment: The template deployment 'search-service' is not valid according to the validation procedure. The tracking id is '9050f6ed-e5c4-4144-8580-774cf6cdfe04'. See inner errors for details. ServiceNameUnavailable: Cannot provision service 'chesco-cog-search' because a service with this name is already in use, or another request to provision a service with this name is still in progress

Expected/desired behavior

to create the search within our existing free tier. We have 1 index free still in our quota and plenty of space in our quota

OS and Version?

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

azd version?

run azd version and copy paste here.

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

pamelafox commented 1 year ago

Did you also try azd env set AZURE_SEARCH_SERVICE_RESOURCE_GROUP group-name? I assume that service is in a different resource group than the new one being created.

KellyChesco commented 1 year ago

No we didn't but we just tried it with the AZURE_SEARCH_SERVICE_RESOURCE_GROUP set and got the same result. It tries to create a search service "service 'chesco-cog-search' because a service with this name is already in use"

AZURE_ENV_NAME="azure-search-openai-demo" AZURE_LOCATION="eastus" AZURE_SEARCH_SERVICE="chesco-cog-search" AZURE_SEARCH_SERVICE_RESOURCE_GROUP="AzureCognitiveSearch" AZURE_SUBSCRIPTION_ID="xxxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxxxxxx"

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: InvalidTemplateDeployment: The template deployment 'search-service' is not valid according to the validation procedure. The tracking id is 'df9916f5-cae4-44f1-8873-54d950799646'. See inner errors for details. ServiceNameUnavailable: Cannot provision service 'chesco-cog-search' because a service with this name is already in use, or another request to provision a service with this name is still in progress

TraceID: 29a512f250089f6bbe8c6badb6db7605

KellyChesco commented 1 year ago

We realized the AZURE_SEARCH_SERVICE_RESOURCE_GROUP was wrong for our existing resource group so we changed to. AZURE_SEARCH_SERVICE_RESOURCE_GROUP="AzureCognitiveSearch" To AZURE_SEARCH_SERVICE_RESOURCE_GROUP="DCIS"

Then we reran "AZD up" and got the following error

(✓) Done: Storage account: stpeqbrk6t7qg36 (✓) Done: App Service plan: plan-peqbrk6t7qg36 (✓) Done: Form recognizer: cog-fr-peqbrk6t7qg36 (✓) Done: Azure OpenAI: cog-peqbrk6t7qg36

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: BadRequest: Cannot update sku for an existing search service. RequestId: 16176beb-f57d-c346-35af-182e02eaaaff

TraceID: 16176bebf57dc34635af182e02eaaaff | | Creating/Updating resources

pamelafox commented 1 year ago

Hm, our main.bicep makes a service with sku "standard", due to this line:

param searchServiceSkuName string = 'standard'

You'll need to change that line to match your existing one. The options are listed here: https://learn.microsoft.com/en-us/azure/templates/microsoft.search/searchservices?pivots=deployment-language-bicep#sku

KellyChesco commented 1 year ago

Hi Pamela,

We actually found that and made that change, and in a couple other files yesterday after poking around a bit.

[infra/core/search/search-services.bicep] param sku object = { name: 'standard' }

[infra/main.parameters.json] "searchServiceSkuName": { "value": "standard" },

Unfortunately none of these changes worked. We mostly got errors like this:


(✓) Done: Storage account: stpeqbrk6t7qg36 (✓) Done: App Service plan: plan-peqbrk6t7qg36 (✓) Done: Form recognizer: cog-fr-peqbrk6t7qg36 (✓) Done: Azure OpenAI: cog-peqbrk6t7qg36

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: BadRequest: Cannot update sku for an existing search service. RequestId: 16176beb-f57d-c346-35af-182e02eaaaff


Oddly enough changing one of them, I wish I could remember which, triggered an unexpected error below deploying the text embedding resource ada.


ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: BadRequest: Resource identity is not supported for the selected SKU InvalidTemplateDeployment: The template deployment 'openai' is not valid according to the validation procedure. The tracking id is '2faf22b4-9231-4acd-9654-bf32c2fa11c3'. See inner errors for details. InvalidResourceProperties: The specified SKU 'Free' of account deployment is not supported by the model 'text-embedding-ada-002' version: '2'.


We switched it back and the last message we received before calling it a day was another odd one


Deployment Error Details: InvalidTemplateDeployment: The template deployment 'search-service' is not valid according to the validation procedure. The tracking id is 'abb56b6f-c52e-4fdc-bbcb-5019bbcbc889'. See inner errors for details. ServiceNameUnavailable: Cannot provision service 'chesco-cog-search' because a service with this name is already in use, or another request to provision a service with this name is still in progress


We can see here it trying to deploy to the correct resource group

https://i.imgur.com/NriakM1.png

But fails with the message: Cannot update sku for an existing search service. RequestId: 1511cdd3-7ea3-6d4a-d0b4-d3e010a54011 (Code: BadRequest)

pamelafox commented 1 year ago

@KellyChesco Sorry it's been a pain. I've tested it out myself and sent a PR that should make it slightly easier: https://github.com/Azure-Samples/azure-search-openai-demo/pull/620

Basically, you'll need to override all of the parameters that differ from the default - search service name, search service resource group, search service location, search service SKU.

I wonder if you accidentally changed the OpenAI sku instead of the search service SKU? That's usually S0 in our code, and I believe that's the only option.

KellyChesco commented 1 year ago

@pamelafox No worries, It was working well with the default settings but we are still evaluating and during that period need to use the free tier if possible.

Thanks for the env settings, we set them all but it looks like its trying to update the current sku in the existing search service with the same value and that doesn't seem possible? Do you know if anyone else has been able to use an existing free teir successfully?


AZURE_ENV_NAME="azure-search-openai-demo" AZURE_LOCATION="eastus" AZURE_SEARCH_SERVICE="chesco-cog-search" AZURE_SEARCH_SERVICE_LOCATION="East US" AZURE_SEARCH_SERVICE_RESOURCE_GROUP="DCIS" AZURE_SEARCH_SERVICE_SKU="Free"


ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: BadRequest: Cannot update sku for an existing search service. RequestId: 09cfaf41-a8e0-f04e-fbf6-df828ce16f61

TraceID: 09cfaf41a8e0f04efbf6df828ce16f61


also tried but got the same results

AZURE_ENV_NAME="azure-search-openai-demo" AZURE_LOCATION="eastus" AZURE_SEARCH_SERVICE="chesco-cog-search" AZURE_SEARCH_SERVICE_LOCATION="eastus" AZURE_SEARCH_SERVICE_RESOURCE_GROUP="DCIS" AZURE_SEARCH_SERVICE_SKU="Free"

pamelafox commented 1 year ago

Ah, I'm trying with a free search service now, and I realize that free search service does not support semantic search or managed identity: https://learn.microsoft.com/en-us/azure/search/search-sku-tier#feature-availability-by-tier

Given that, a free search service isn't currently compatible with this sample, you'd have to use a higher tier. Sorry! I'll ask the team if there are any plans to enable managed identity for that tier.

KellyChesco commented 1 year ago

Thanks Pamela, great find. We will revaluate our deployment plan.

KellyChesco commented 1 year ago

FYI, I found the document I initially read that led me to think there was a free tier for Semantic Search. https://azure.microsoft.com/en-us/pricing/details/search/

Screenshot

pmtang commented 1 year ago

@pamelafox So the Basic tier of search service is sufficient with this sample?

pamelafox commented 1 year ago

@KellyChesco Ah, thats confusing because there are tiers for semantic search that are different than the tiers for Azure Cognitive Search, and both have a free tier level. I agree that's confusing, I'll pass your feedback on.

@pmtang Yes, basic should be fine, it seems to support managed identity and semantic search. https://learn.microsoft.com/en-us/azure/search/search-sku-tier#feature-availability-by-tier

github-actions[bot] commented 12 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.

pamelafox commented 12 months ago

The README now mentions that free sku doesn't work, so there's no additional work we can do on this issue, as far as I can see.

dan-angelson commented 11 months ago

Sorry to reopen this but it doesn't appear that you can change the SKU of an already existing Search Service:

https://learn.microsoft.com/en-us/azure/search/search-sku-tier?WT.mc_id=AI-MVP-5003365#tier-upgrade-or-downgrade

pamelafox commented 11 months ago

Good to know, thanks for the link! Is there anywhere particular in the readme you think that should be mentioned? Or something you hoped we could do on the code side?

dan-angelson commented 11 months ago

Hi Pamela,

Happy to help. I would just make a note of this in the Readme, in the section about using an Existing Azure AI Search resource. Point 4 would need to be reworked to say that if the resource isn't in a supported SKU, it will need to be re-deployed as it is not possible to change the SKU of an already running AI Search instance.

pamelafox commented 11 months ago

Great point, adding note in https://github.com/Azure-Samples/azure-search-openai-demo/pull/1019