Azure-Samples / azure-cognitive-search-blob-metadata

This sample demonstrates how to use multiple indexers in Azure Cognitive Search to create a single search index from files in Blob storage with their associated metadata in Table storage
MIT License
5 stars 1 forks source link

Update modules to Azure AI Search (instead of Cog. Search) + outdated code error #2

Open MadinaKamolova opened 1 month ago

MadinaKamolova commented 1 month 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
- [x] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

In Azure ML, start compute (mine has STANDARD_DS11_V2 size), through it open JupyterLab, then open Bash. Run git clone https://github.com/Azure-Samples/azure-cognitive-search-blob-metadata.git cd azure-cognitive-search-blob-metadata per Readme. Edit the first few lines in deploy.azcli also per Readme, and run them in Bash. The last line in this code excerpt produces an error: ```# Set the main variables for the sample (modify these for your environment). REGION=<your region, for example 'westeurope'> RESOURCEGROUPNAME=<your resource group name, max. 14 characters>

Derive other variables (these should not be updated).

STORAGEACCOUNTNAME=$RESOURCEGROUPNAME"storage" STORAGEACCOUNTCONTAINERNAME=samplefiles STORAGEACCOUNTTABLENAME=$STORAGEACCOUNTCONTAINERNAME"metadata" COGNITIVESEARCHNAME=$RESOURCEGROUPNAME"cognitivesearch" INDEXNAME=$STORAGEACCOUNTCONTAINERNAME-index BLOBDATASOURCENAME=$STORAGEACCOUNTCONTAINERNAME-blob-datasource BLOBINDEXERNAME=$STORAGEACCOUNTCONTAINERNAME-blob-indexer TABLEDATASOURCENAME=$STORAGEACCOUNTCONTAINERNAME-table-datasource TABLEINDEXERNAME=$STORAGEACCOUNTCONTAINERNAME-table-indexer COGNITIVESEARCHAPIVERSION=2020-06-30

Log in to Azure using the CLI (you can skip this if you're already logged in).

az login

Create the resource group and supporting storage services.

az group create --location $REGION --name $RESOURCEGROUPNAME az storage account create --location $REGION --resource-group $RESOURCEGROUPNAME --name $STORAGEACCOUNTNAME --kind StorageV2 --sku Standard_LRS```

Any log messages given by the failure

ValueError: API version 2022-09-01 does not have operation group 'storage_accounts'. ImportError: cannot import name 'PersistenceError' from 'msal_extensions.persistence' (/anaconda/envs/azureml_py38/lib/python3.8/site-packages/msal_extensions/persistence.py)

Expected/desired behavior

No errors or methods to resolve these errors.

OS and Version?

Azure ML with STANDARD_DS11_V2 compute, running in Bash of a JupyterLab environment.

Versions

Irrelevant.

Mention any other details that might be useful

Hey! Azure AI Search is the new name and (my assumption) upgraded version of Azure Cognitive Search. I see that you were able to add metadata to files in Cognitive Search index through Azure Table Storage. Can you please release the update for how to do this for Azure AI Search instead of Cognitive Search? I have tried following your readme anyway, but get the two errors marked above. Microsoft is aware of the first one but there is no solution: https://github.com/Azure/azure-cli/issues/26417. Thanks for putting this together!


Thanks! We'll be in touch soon.

jelledruyts commented 3 weeks ago

Hi Madina, apologies for the delay but I've just tried to execute the steps in the deploy.azcli file again and everything still works as expected for me. I do see you're running on an Azure ML virtual machine, perhaps (looking at the CLI error) that is causing some conflicts with the Azure CLI?

The fact that the product is now called Azure AI Search (no longer Azure Cognitive Search) makes no technical difference by the way, so that's not a problem :-)

MadinaKamolova commented 3 weeks ago

Hi Jelle, thank you for rerunning it. I will try again from a local machine.