Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused cogservices account #392

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions infra/core/search/search-services.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
param name string
param cogServicesName string
param location string = resourceGroup().location
param tags object = {}

Expand All @@ -9,12 +8,7 @@ param sku object = {

param authOptions object = {}
param semanticSearch string = 'disabled'
param kind string = 'CognitiveServices'
param publicNetworkAccess string = 'Enabled'
param isGovCloudDeployment bool
param cogServicesSku object = {
name: 'S0'
}

resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = {
name: name
Expand Down Expand Up @@ -43,21 +37,9 @@ resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = {
sku: sku
}

resource cogService 'Microsoft.CognitiveServices/accounts@2022-10-01' = {
name: cogServicesName
location: location
tags: tags
kind: kind
properties: {
publicNetworkAccess: publicNetworkAccess
}
sku: cogServicesSku
}

output id string = search.id
output endpoint string = (isGovCloudDeployment) ? 'https://${name}.search.azure.us/' : 'https://${name}.search.windows.net/'
output name string = search.name
#disable-next-line outputs-should-not-contain-secrets
output searchServiceKey string = search.listAdminKeys().primaryKey
#disable-next-line outputs-should-not-contain-secrets
output cogServiceKey string = cogService.listKeys().key1
10 changes: 0 additions & 10 deletions infra/core/security/keyvault.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ param searchServiceKey string
@secure()
param openaiServiceKey string
@secure()
param cogServicesSearchKey string
@secure()
param cosmosdbKey string
@secure()
param formRecognizerKey string
Expand Down Expand Up @@ -66,14 +64,6 @@ resource openaiServiceKeySecret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' =
}
}

resource cogServicesSearchKeySecret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
parent: kv
name: 'COGNITIVE-SERVICES-KEY'
properties: {
value: cogServicesSearchKey
}
}

resource cosmosdbKeySecret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
parent: kv
name: 'COSMOSDB-KEY'
Expand Down
7 changes: 0 additions & 7 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ param azureOpenAIResourceGroup string
param azureOpenAIServiceKey string
param openAiServiceName string = ''
param openAiSkuName string = 'S0'
param cognitiveServiesForSearchName string = ''
param cosmosdbName string = ''
param formRecognizerName string = ''
param enrichmentName string = ''
param formRecognizerSkuName string = 'S0'
param enrichmentSkuName string = 'S0'
param cognitiveServiesForSearchSku string = 'S0'
param appServicePlanName string = ''
param enrichmentAppServicePlanName string = ''
param resourceGroupName string = ''
Expand Down Expand Up @@ -378,10 +376,6 @@ module searchServices 'core/search/search-services.bicep' = {
name: searchServicesSkuName
}
semanticSearch: 'free'
cogServicesName: !empty(cognitiveServiesForSearchName) ? cognitiveServiesForSearchName : '${prefix}-${abbrs.cognitiveServicesAccounts}${randomString}'
cogServicesSku: {
name: cognitiveServiesForSearchSku
}
isGovCloudDeployment: isGovCloudDeployment
}
}
Expand Down Expand Up @@ -713,7 +707,6 @@ module kvModule 'core/security/keyvault.bicep' = {
kvAccessObjectId: kvAccessObjectId
searchServiceKey: searchServices.outputs.searchServiceKey
openaiServiceKey: azureOpenAIServiceKey
cogServicesSearchKey: searchServices.outputs.cogServiceKey
cosmosdbKey: cosmosdb.outputs.CosmosDBKey
formRecognizerKey: formrecognizer.outputs.formRecognizerAccountKey
blobConnectionString: storage.outputs.connectionString
Expand Down
2 changes: 1 addition & 1 deletion scripts/json-to-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fi
# Name of your Key Vault
keyVaultName=$(cat infra_output.json | jq -r .properties.outputs.deploymenT_KEYVAULT_NAME.value)
# Names of your secrets
secretNames=("AZURE-SEARCH-SERVICE-KEY" "AZURE-BLOB-STORAGE-KEY" "BLOB-CONNECTION-STRING" "COSMOSDB-KEY" "COGNITIVE-SERVICES-KEY" "AZURE-OPENAI-SERVICE-KEY")
secretNames=("AZURE-SEARCH-SERVICE-KEY" "AZURE-BLOB-STORAGE-KEY" "BLOB-CONNECTION-STRING" "COSMOSDB-KEY" "AZURE-OPENAI-SERVICE-KEY")

# Retrieve and export each secret
for secretName in "${secretNames[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion scripts/json-to-env.webapp.debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fi
keyVaultName=$(cat infra_output.json | jq -r .properties.outputs.deploymenT_KEYVAULT_NAME.value)

# Names of your secrets
secretNames=("AZURE-SEARCH-SERVICE-KEY" "AZURE-BLOB-STORAGE-KEY" "BLOB-CONNECTION-STRING" "COSMOSDB-KEY" "AZURE-OPENAI-SERVICE-KEY" "COGNITIVE-SERVICES-KEY" "AZURE-CLIENT-SECRET")
secretNames=("AZURE-SEARCH-SERVICE-KEY" "AZURE-BLOB-STORAGE-KEY" "BLOB-CONNECTION-STRING" "COSMOSDB-KEY" "AZURE-OPENAI-SERVICE-KEY" "AZURE-CLIENT-SECRET")

# Retrieve and export each secret
for secretName in "${secretNames[@]}"; do
Expand Down
Loading