Skip to content

Commit 7d7a243

Browse files
fix: Merge pull request #255 from microsoft/dev
fix: AI Services like CU custom endpoint URI
2 parents b7d379b + 794e11b commit 7d7a243

File tree

2 files changed

+43
-23
lines changed

2 files changed

+43
-23
lines changed

infra/deploy_ai_foundry.bicep

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ param managedIdentityObjectId string
1414
var storageName = '${solutionName}hubstorage'
1515
var storageSkuName = 'Standard_LRS'
1616
var aiServicesName = '${solutionName}-aiservices'
17-
var aiServicesName_cu = '${solutionName}-aiservices_cu'
17+
var aiServicesName_cu = '${solutionName}-aiservices-cu'
1818
var location_cu = cuLocation
1919
// var aiServicesName_m = '${solutionName}-aiservices_m'
2020
// var location_m = solutionLocation
21+
var workspaceName = '${solutionName}-workspace'
2122
var applicationInsightsName = '${solutionName}-appinsights'
2223
var containerRegistryName = '${solutionName}acr'
2324
var keyvaultName = '${solutionName}-kv'
@@ -55,21 +56,27 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
5556
name: keyVaultName
5657
}
5758

59+
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
60+
name: workspaceName
61+
location: location
62+
tags: {}
63+
properties: {
64+
retentionInDays: 30
65+
sku: {
66+
name: 'PerGB2018'
67+
}
68+
}
69+
}
70+
5871
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
5972
name: applicationInsightsName
6073
location: location
6174
kind: 'web'
6275
properties: {
6376
Application_Type: 'web'
64-
DisableIpMasking: false
65-
DisableLocalAuth: false
66-
Flow_Type: 'Bluefield'
67-
ForceCustomerStorageForProfiler: false
68-
ImmediatePurgeDataOn30Days: true
69-
IngestionMode: 'ApplicationInsights'
7077
publicNetworkAccessForIngestion: 'Enabled'
7178
publicNetworkAccessForQuery: 'Disabled'
72-
Request_Source: 'rest'
79+
WorkspaceResourceId: logAnalytics.id
7380
}
7481
}
7582

@@ -194,14 +201,15 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
194201
// }
195202
// }
196203

197-
resource aiServices_CU 'Microsoft.CognitiveServices/accounts@2021-10-01' = {
204+
resource aiServices_CU 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = {
198205
name: aiServicesName_cu
199206
location: location_cu
200207
sku: {
201208
name: 'S0'
202209
}
203210
kind: 'AIServices'
204211
properties: {
212+
customSubDomainName: aiServicesName_cu
205213
apiProperties: {
206214
statisticsEnabled: false
207215
}

infra/main.json

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.33.93.31351",
8-
"templateHash": "770098073876871961"
8+
"templateHash": "126835841607797415"
99
}
1010
},
1111
"parameters": {
@@ -366,7 +366,7 @@
366366
"_generator": {
367367
"name": "bicep",
368368
"version": "0.33.93.31351",
369-
"templateHash": "16302841985782460131"
369+
"templateHash": "16925264059668982974"
370370
}
371371
},
372372
"parameters": {
@@ -408,8 +408,9 @@
408408
"storageName": "[format('{0}hubstorage', parameters('solutionName'))]",
409409
"storageSkuName": "Standard_LRS",
410410
"aiServicesName": "[format('{0}-aiservices', parameters('solutionName'))]",
411-
"aiServicesName_cu": "[format('{0}-aiservices_cu', parameters('solutionName'))]",
411+
"aiServicesName_cu": "[format('{0}-aiservices-cu', parameters('solutionName'))]",
412412
"location_cu": "[parameters('cuLocation')]",
413+
"workspaceName": "[format('{0}-workspace', parameters('solutionName'))]",
413414
"applicationInsightsName": "[format('{0}-appinsights', parameters('solutionName'))]",
414415
"containerRegistryName": "[format('{0}acr', parameters('solutionName'))]",
415416
"keyvaultName": "[format('{0}-kv', parameters('solutionName'))]",
@@ -512,6 +513,19 @@
512513
"[resourceId('Microsoft.Search/searchServices', variables('aiSearchName'))]"
513514
]
514515
},
516+
{
517+
"type": "Microsoft.OperationalInsights/workspaces",
518+
"apiVersion": "2023-09-01",
519+
"name": "[variables('workspaceName')]",
520+
"location": "[variables('location')]",
521+
"tags": {},
522+
"properties": {
523+
"retentionInDays": 30,
524+
"sku": {
525+
"name": "PerGB2018"
526+
}
527+
}
528+
},
515529
{
516530
"type": "Microsoft.Insights/components",
517531
"apiVersion": "2020-02-02",
@@ -520,16 +534,13 @@
520534
"kind": "web",
521535
"properties": {
522536
"Application_Type": "web",
523-
"DisableIpMasking": false,
524-
"DisableLocalAuth": false,
525-
"Flow_Type": "Bluefield",
526-
"ForceCustomerStorageForProfiler": false,
527-
"ImmediatePurgeDataOn30Days": true,
528-
"IngestionMode": "ApplicationInsights",
529537
"publicNetworkAccessForIngestion": "Enabled",
530538
"publicNetworkAccessForQuery": "Disabled",
531-
"Request_Source": "rest"
532-
}
539+
"WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName'))]"
540+
},
541+
"dependsOn": [
542+
"[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName'))]"
543+
]
533544
},
534545
{
535546
"type": "Microsoft.ContainerRegistry/registries",
@@ -580,14 +591,15 @@
580591
},
581592
{
582593
"type": "Microsoft.CognitiveServices/accounts",
583-
"apiVersion": "2021-10-01",
594+
"apiVersion": "2024-04-01-preview",
584595
"name": "[variables('aiServicesName_cu')]",
585596
"location": "[variables('location_cu')]",
586597
"sku": {
587598
"name": "S0"
588599
},
589600
"kind": "AIServices",
590601
"properties": {
602+
"customSubDomainName": "[variables('aiServicesName_cu')]",
591603
"apiProperties": {
592604
"statisticsEnabled": false
593605
}
@@ -853,7 +865,7 @@
853865
"apiVersion": "2021-11-01-preview",
854866
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-CU-ENDPOINT')]",
855867
"properties": {
856-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2021-10-01').endpoint]"
868+
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2024-04-01-preview').endpoint]"
857869
},
858870
"dependsOn": [
859871
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu'))]"
@@ -864,7 +876,7 @@
864876
"apiVersion": "2021-11-01-preview",
865877
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-CU-KEY')]",
866878
"properties": {
867-
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2021-10-01').key1]"
879+
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2024-04-01-preview').key1]"
868880
},
869881
"dependsOn": [
870882
"[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu'))]"

0 commit comments

Comments
 (0)