Skip to content

Commit

Permalink
add unique ID to search resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ivorb authored Sep 5, 2024
1 parent 6a33da9 commit 660d9f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Labfiles/04-custom-skill/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ resourceGroupName=FormsRecognizerResources
printf "${GREEN}Setting up the $resourceGroupName resource group. \n${NORMAL}"
az group create --location westus --name FormsRecognizerResources

# Get random numbers to create unique resource names
unique_id=$((1 + RANDOM % 99999))

# Create the Forms Recognizer resource
printf "${GREEN}Setting up the Forms Recognizer resource. \n${NORMAL}"
# First, purge it in case there's a recently deleted one
Expand All @@ -22,6 +25,6 @@ printf "${GREEN}Setting up Azure Cognitive Search. \n${NORMAL}"
# Purge any existing search resource with the same name
az resource delete --ids "/subscriptions/${SubID}/resourceGroups/${resourceGroupName}/providers/Microsoft.Search/searchServices/enrichedcognitivesearch"
# Now, create the new one
az search service create --name enrichedcognitivesearch --location westus --resource-group $resourceGroupName --sku Free --partition-count 1 --replica-count 1
az search service create --name "enrichedcognitivesearch$unique_id" --location westus --resource-group $resourceGroupName --sku Free --partition-count 1 --replica-count 1

printf "${GREEN}Setup completed. \n${NORMAL}"

0 comments on commit 660d9f5

Please sign in to comment.