Skip to content

Commit b49d4ad

Browse files
fix: removed the use of the AZURE-OPENAI-CU-KEY secret across the infrastructure and scripts
2 parents 8499a42 + c40eb79 commit b49d4ad

File tree

6 files changed

+3
-31
lines changed

6 files changed

+3
-31
lines changed

infra/deploy_ai_foundry.bicep

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,6 @@ resource azureOpenAICUEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-0
300300
}
301301
}
302302

303-
resource azureOpenAICUApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
304-
parent: keyVault
305-
name: 'AZURE-OPENAI-CU-KEY'
306-
properties: {
307-
value: aiServices_CU.listKeys().key1
308-
}
309-
}
310-
311303
resource azureOpenAICUApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
312304
parent: keyVault
313305
name: 'AZURE-OPENAI-CU-VERSION'

infra/main.json

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.36.1.42791",
8-
"templateHash": "14769206549361904379"
8+
"templateHash": "14797468639789152416"
99
}
1010
},
1111
"parameters": {
@@ -652,7 +652,7 @@
652652
"_generator": {
653653
"name": "bicep",
654654
"version": "0.36.1.42791",
655-
"templateHash": "1294065809838303541"
655+
"templateHash": "1288056001550775266"
656656
}
657657
},
658658
"parameters": {
@@ -1213,17 +1213,6 @@
12131213
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu'))]"
12141214
]
12151215
},
1216-
{
1217-
"type": "Microsoft.KeyVault/vaults/secrets",
1218-
"apiVersion": "2021-11-01-preview",
1219-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-CU-KEY')]",
1220-
"properties": {
1221-
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2025-04-01-preview').key1]"
1222-
},
1223-
"dependsOn": [
1224-
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu'))]"
1225-
]
1226-
},
12271216
{
12281217
"type": "Microsoft.KeyVault/vaults/secrets",
12291218
"apiVersion": "2021-11-01-preview",
@@ -2521,7 +2510,7 @@
25212510
"_generator": {
25222511
"name": "bicep",
25232512
"version": "0.36.1.42791",
2524-
"templateHash": "12601944025413037469"
2513+
"templateHash": "2610739623677529550"
25252514
}
25262515
},
25272516
"parameters": {
@@ -2827,7 +2816,6 @@
28272816
}
28282817
},
28292818
{
2830-
"condition": "[not(empty(parameters('azureExistingAIProjectResourceId')))]",
28312819
"type": "Microsoft.Resources/deployments",
28322820
"apiVersion": "2022-09-01",
28332821
"name": "assignAiUserRoleToAiProject",

infra/scripts/index_scripts/02_create_cu_template_audio.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def get_secrets_from_kv(kv_name, secret_name):
2828
sys.path.append(str(parent_dir))
2929
from content_understanding_client import AzureContentUnderstandingClient
3030
AZURE_AI_ENDPOINT = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-ENDPOINT")
31-
AZURE_OPENAI_CU_KEY = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-KEY")
3231
AZURE_AI_API_VERSION = "2024-12-01-preview"
3332

3433

@@ -37,7 +36,6 @@ def get_secrets_from_kv(kv_name, secret_name):
3736
client = AzureContentUnderstandingClient(
3837
endpoint=AZURE_AI_ENDPOINT,
3938
api_version=AZURE_AI_API_VERSION,
40-
subscription_key=AZURE_OPENAI_CU_KEY,
4139
token_provider=token_provider
4240
)
4341

infra/scripts/index_scripts/02_create_cu_template_text.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def get_secrets_from_kv(kv_name, secret_name):
2828
sys.path.append(str(parent_dir))
2929
from content_understanding_client import AzureContentUnderstandingClient
3030
AZURE_AI_ENDPOINT = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-ENDPOINT")
31-
AZURE_OPENAI_CU_KEY = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-KEY")
3231
AZURE_AI_API_VERSION = "2024-12-01-preview"
3332

3433

@@ -38,7 +37,6 @@ def get_secrets_from_kv(kv_name, secret_name):
3837
client = AzureContentUnderstandingClient(
3938
endpoint=AZURE_AI_ENDPOINT,
4039
api_version=AZURE_AI_API_VERSION,
41-
subscription_key=AZURE_OPENAI_CU_KEY,
4240
token_provider=token_provider
4341
)
4442

infra/scripts/index_scripts/03_cu_process_data_text.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ def chunk_data(text):
182182

183183

184184
AZURE_AI_ENDPOINT = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-ENDPOINT")
185-
AZURE_OPENAI_CU_KEY = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-KEY")
186185
AZURE_AI_API_VERSION = "2024-12-01-preview"
187186

188187
credential = DefaultAzureCredential(managed_identity_client_id=managed_identity_client_id)
@@ -191,7 +190,6 @@ def chunk_data(text):
191190
client = AzureContentUnderstandingClient(
192191
endpoint=AZURE_AI_ENDPOINT,
193192
api_version=AZURE_AI_API_VERSION,
194-
subscription_key=AZURE_OPENAI_CU_KEY,
195193
token_provider=token_provider
196194
)
197195

infra/scripts/index_scripts/04_cu_process_data_new_data.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ def create_search_index():
256256

257257

258258
AZURE_AI_ENDPOINT = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-ENDPOINT")
259-
AZURE_OPENAI_CU_KEY = get_secrets_from_kv(key_vault_name,"AZURE-OPENAI-CU-KEY")
260259
AZURE_AI_API_VERSION = "2024-12-01-preview"
261260

262261
credential = DefaultAzureCredential()
@@ -265,7 +264,6 @@ def create_search_index():
265264
client = AzureContentUnderstandingClient(
266265
endpoint=AZURE_AI_ENDPOINT,
267266
api_version=AZURE_AI_API_VERSION,
268-
subscription_key=AZURE_OPENAI_CU_KEY,
269267
token_provider=token_provider
270268
)
271269

0 commit comments

Comments
 (0)