diff --git a/infra/abbreviations.json b/infra/abbreviations.json index 93b95656..9d232cc8 100644 --- a/infra/abbreviations.json +++ b/infra/abbreviations.json @@ -2,6 +2,8 @@ "ai": { "aiSearch": "srch-", "aiServices": "aisa-", + "aiFoundry": "aif-", + "aiFoundryProject": "aifp-", "aiVideoIndexer": "avi-", "machineLearningWorkspace": "mlw-", "openAIService": "oai-", diff --git a/infra/deploy_ai_foundry.bicep b/infra/deploy_ai_foundry.bicep index 9c91be13..e4fa02ff 100644 --- a/infra/deploy_ai_foundry.bicep +++ b/infra/deploy_ai_foundry.bicep @@ -1,34 +1,22 @@ // Creates Azure dependent resources for Azure AI studio param solutionName string param solutionLocation string -param keyVaultName string param cuLocation string param deploymentType string param gptModelName string param gptModelVersion string param gptDeploymentCapacity int -// param embeddingModel string -// param embeddingDeploymentCapacity int -param managedIdentityObjectId string -param applicationInsightsId string -param containerRegistryId string // Load the abbrevations file required to name the azure resources. var abbrs = loadJsonContent('./abbreviations.json') -var storageName = '${abbrs.storage.storageAccount}${solutionName}hubs' -var storageSkuName = 'Standard_LRS' -var aiServicesName = '${abbrs.ai.aiServices}${solutionName}' +var aiFoundaryName = '${abbrs.ai.aiFoundry}${solutionName}' var aiServicesName_cu = '${abbrs.ai.aiServices}${solutionName}-cu' var location_cu = cuLocation -// var aiServicesName_m = '${solutionName}-aiservices_m' -// var location_m = solutionLocation -var location = solutionLocation //'eastus2' -var aiHubName = '${abbrs.ai.aiHub}${solutionName}' -var aiHubFriendlyName = aiHubName -var aiHubDescription = 'AI Hub for CPS template' -var aiProjectName = '${abbrs.ai.aiHubProject}${solutionName}' -var aiProjectFriendlyName = aiProjectName + +var location = solutionLocation +var aiProjectDescription = 'AI foundary project for CPS template' +var aiProjectName = '${abbrs.ai.aiFoundryProject}${solutionName}' var aiModelDeployments = [ { name: gptModelName @@ -51,14 +39,8 @@ var aiModelDeployments = [ // } ] -resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { - name: keyVaultName -} - -var storageNameCleaned = replace(storageName, '-', '') - -resource aiServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = { - name: aiServicesName +resource aiFoundry 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = { + name: aiFoundaryName location: location identity: { type: 'SystemAssigned' @@ -68,15 +50,26 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2021-10-01' = { } kind: 'AIServices' properties: { - customSubDomainName: aiServicesName - apiProperties: { - // statisticsEnabled: false - } + allowProjectManagement: true + customSubDomainName: aiFoundaryName publicNetworkAccess: 'Enabled' disableLocalAuth: true } } +resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = { + parent: aiFoundry + name: aiProjectName + location: location + identity: { + type: 'SystemAssigned' + } + properties: { + description: aiProjectDescription + displayName: aiProjectName + } +} + resource aiServices_CU 'Microsoft.CognitiveServices/accounts@2021-10-01' = { name: aiServicesName_cu location: location_cu @@ -89,9 +82,6 @@ resource aiServices_CU 'Microsoft.CognitiveServices/accounts@2021-10-01' = { kind: 'AIServices' properties: { customSubDomainName: aiServicesName_cu - apiProperties: { - // statisticsEnabled: false - } publicNetworkAccess: 'Enabled' disableLocalAuth: true } @@ -99,7 +89,7 @@ resource aiServices_CU 'Microsoft.CognitiveServices/accounts@2021-10-01' = { @batchSize(1) resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for aiModeldeployment in aiModelDeployments: { - parent: aiServices //aiServices_m + parent: aiFoundry //aiServices_m name: aiModeldeployment.name properties: { model: { @@ -115,129 +105,16 @@ resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments } }] -resource storage 'Microsoft.Storage/storageAccounts@2022-09-01' = { - name: storageNameCleaned - location: location - sku: { - name: storageSkuName - } - kind: 'StorageV2' - properties: { - accessTier: 'Hot' - allowBlobPublicAccess: false - allowCrossTenantReplication: false - allowSharedKeyAccess: true - encryption: { - keySource: 'Microsoft.Storage' - requireInfrastructureEncryption: false - services: { - blob: { - enabled: true - keyType: 'Account' - } - file: { - enabled: true - keyType: 'Account' - } - queue: { - enabled: true - keyType: 'Service' - } - table: { - enabled: true - keyType: 'Service' - } - } - } - isHnsEnabled: false - isNfsV3Enabled: false - keyPolicy: { - keyExpirationPeriodInDays: 7 - } - largeFileSharesState: 'Disabled' - minimumTlsVersion: 'TLS1_2' - networkAcls: { - bypass: 'AzureServices' - defaultAction: 'Allow' - } - supportsHttpsTrafficOnly: true - } -} - -@description('This is the built-in Storage Blob Data Contributor.') -resource blobDataContributor 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = { - scope: resourceGroup() - name: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' -} - -resource storageroleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid(resourceGroup().id, managedIdentityObjectId, blobDataContributor.id) - properties: { - principalId: managedIdentityObjectId - roleDefinitionId: blobDataContributor.id - principalType: 'ServicePrincipal' - } -} - -resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview' = { - name: aiHubName - location: location - identity: { - type: 'SystemAssigned' - } - properties: { - // organization - friendlyName: aiHubFriendlyName - description: aiHubDescription - - // dependent resources - keyVault: keyVault.id - storageAccount: storage.id - applicationInsights: applicationInsightsId - containerRegistry: containerRegistryId - } - kind: 'hub' - resource aiServicesConnection 'connections@2024-07-01-preview' = { - name: '${aiHubName}-connection-AzureOpenAI' - properties: { - category: 'AIServices' - target: aiServices.properties.endpoint - authType: 'AAD' - isSharedToAll: true - metadata: { - ApiType: 'Azure' - ResourceId: aiServices.id - } - } - dependsOn: [ - aiServicesDeployments - ] - } -} - -resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' = { - name: aiProjectName - location: location - kind: 'Project' - identity: { - type: 'SystemAssigned' - } - properties: { - friendlyName: aiProjectFriendlyName - hubResourceId: aiHub.id - } -} - -output aiServicesTarget string = aiServices.properties.endpoint //aiServices_m.properties.endpoint +output aiServicesTarget string = aiFoundry.properties.endpoint //aiServices_m.properties.endpoint output aiServicesCUEndpoint string = aiServices_CU.properties.endpoint //aiServices_m.properties.endpoint -output aiServicesName string = aiServicesName //aiServicesName_m -output aiServicesId string = aiServices.id //aiServices_m.id +output aiFoundaryName string = aiFoundaryName //aiFoundaryName +output aiServicesId string = aiFoundry.id //aiServices_m.id output aiServicesCuId string = aiServices_CU.id //aiServices_cu.id -output aiServicePrincipalId string = aiServices.identity.principalId +output aiServicePrincipalId string = aiFoundry.identity.principalId output aiServiceCuPrincipalId string = aiServices_CU.identity.principalId // output aiInfereceEndpoint string = phiserverless.properties.inferenceEndpoint.uri -output aiProjectPrincipalId string = aiHubProject.identity.principalId -output aiProjectConnectionString string = '${location}.api.azureml.ms;${subscription().subscriptionId};${resourceGroup().name};${aiHubProject.name}' -output aiProjectName string = aiHubProject.name -output aiProjectId string = aiHubProject.id +output aiProjectPrincipalId string = aiFoundry.identity.principalId +output aiProjectConnectionString string = aiFoundryProject.properties.endpoints['AI Foundry API'] +output aiProjectName string = aiFoundryProject.name +output aiProjectId string = aiFoundryProject.id diff --git a/infra/main.bicep b/infra/main.bicep index 99a5b016..b2cb538b 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -135,15 +135,11 @@ module aifoundry 'deploy_ai_foundry.bicep' = { params: { solutionName: solutionPrefix solutionLocation: resourceGroupLocation - keyVaultName: kvault.outputs.keyvaultName cuLocation: contentUnderstandingLocation deploymentType: deploymentType gptModelName: gptModelName gptModelVersion: gptModelVersion gptDeploymentCapacity: gptDeploymentCapacity - managedIdentityObjectId: managedIdentityModule.outputs.managedIdentityOutput.objectId - containerRegistryId: containerRegistry.outputs.createdAcrId - applicationInsightsId: applicationInsights.outputs.id } scope: resourceGroup(resourceGroup().name) } diff --git a/infra/main.json b/infra/main.json index 4f5351e4..4221a0bb 100644 --- a/infra/main.json +++ b/infra/main.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "15234454470886032390" + "version": "0.36.1.42791", + "templateHash": "7133413659987113184" } }, "parameters": { @@ -128,6 +128,10 @@ "metadata": { "description": "Optional: Existing Log Analytics Workspace Resource ID" } + }, + "imageTag": { + "type": "string", + "defaultValue": "latest" } }, "variables": { @@ -135,6 +139,8 @@ "ai": { "aiSearch": "srch-", "aiServices": "aisa-", + "aiFoundry": "aif-", + "aiFoundryProject": "aifp-", "aiVideoIndexer": "avi-", "machineLearningWorkspace": "mlw-", "openAIService": "oai-", @@ -393,8 +399,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "3237931210750164965" + "version": "0.36.1.42791", + "templateHash": "17040083292589011391" } }, "parameters": { @@ -479,8 +485,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "1503106947863889964" + "version": "0.36.1.42791", + "templateHash": "11049431112452456133" } }, "parameters": { @@ -588,8 +594,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "4417744862326794406" + "version": "0.36.1.42791", + "templateHash": "1305630352036876197" } }, "parameters": { @@ -606,6 +612,7 @@ }, "variables": { "useExisting": "[not(empty(parameters('existingLogAnalyticsWorkspaceId')))]", + "existingLawSubscriptionId": "[if(variables('useExisting'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[2], '')]", "existingLawResourceGroup": "[if(variables('useExisting'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[4], '')]", "existingLawName": "[if(variables('useExisting'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[8], '')]" }, @@ -643,7 +650,7 @@ "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": "Disabled", "Request_Source": "rest", - "WorkspaceResourceId": "[if(variables('useExisting'), extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('existingLawResourceGroup')), 'Microsoft.OperationalInsights/workspaces', variables('existingLawName')), resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')))]" + "WorkspaceResourceId": "[if(variables('useExisting'), extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('existingLawSubscriptionId'), variables('existingLawResourceGroup')), 'Microsoft.OperationalInsights/workspaces', variables('existingLawName')), resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')))]" }, "dependsOn": [ "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName'))]" @@ -659,6 +666,10 @@ "type": "string", "value": "[if(variables('useExisting'), variables('existingLawName'), parameters('logAnalyticsWorkspaceName'))]" }, + "logAnalyticsWorkspaceSubscription": { + "type": "string", + "value": "[if(variables('useExisting'), variables('existingLawSubscriptionId'), split(subscription().id, '/')[2])]" + }, "logAnalyticsWorkspaceResourceGroup": { "type": "string", "value": "[if(variables('useExisting'), variables('existingLawResourceGroup'), resourceGroup().name)]" @@ -687,8 +698,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "12870101648257851199" + "version": "0.36.1.42791", + "templateHash": "6955709595359352278" } }, "parameters": { @@ -773,8 +784,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "8070899038568610427" + "version": "0.36.1.42791", + "templateHash": "3200993772301267162" } }, "parameters": { @@ -897,9 +908,6 @@ "solutionLocation": { "value": "[variables('resourceGroupLocation')]" }, - "keyVaultName": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault'), '2022-09-01').outputs.keyvaultName.value]" - }, "cuLocation": { "value": "[parameters('contentUnderstandingLocation')]" }, @@ -914,15 +922,6 @@ }, "gptDeploymentCapacity": { "value": "[parameters('gptDeploymentCapacity')]" - }, - "managedIdentityObjectId": { - "value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity'), '2022-09-01').outputs.managedIdentityOutput.value.objectId]" - }, - "containerRegistryId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'deploy_container_registry'), '2022-09-01').outputs.createdAcrId.value]" - }, - "applicationInsightsId": { - "value": "[reference(resourceId('Microsoft.Resources/deployments', 'deploy_app_insights'), '2022-09-01').outputs.id.value]" } }, "template": { @@ -931,8 +930,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "13810365425953827110" + "version": "0.36.1.42791", + "templateHash": "13978305638370067003" } }, "parameters": { @@ -942,9 +941,6 @@ "solutionLocation": { "type": "string" }, - "keyVaultName": { - "type": "string" - }, "cuLocation": { "type": "string" }, @@ -959,15 +955,6 @@ }, "gptDeploymentCapacity": { "type": "int" - }, - "managedIdentityObjectId": { - "type": "string" - }, - "applicationInsightsId": { - "type": "string" - }, - "containerRegistryId": { - "type": "string" } }, "variables": { @@ -975,6 +962,8 @@ "ai": { "aiSearch": "srch-", "aiServices": "aisa-", + "aiFoundry": "aif-", + "aiFoundryProject": "aifp-", "aiVideoIndexer": "avi-", "machineLearningWorkspace": "mlw-", "openAIService": "oai-", @@ -1199,17 +1188,12 @@ } }, "abbrs": "[variables('$fxv#0')]", - "storageName": "[format('{0}{1}hubs', variables('abbrs').storage.storageAccount, parameters('solutionName'))]", - "storageSkuName": "Standard_LRS", - "aiServicesName": "[format('{0}{1}', variables('abbrs').ai.aiServices, parameters('solutionName'))]", + "aiFoundaryName": "[format('{0}{1}', variables('abbrs').ai.aiFoundry, parameters('solutionName'))]", "aiServicesName_cu": "[format('{0}{1}-cu', variables('abbrs').ai.aiServices, parameters('solutionName'))]", "location_cu": "[parameters('cuLocation')]", "location": "[parameters('solutionLocation')]", - "aiHubName": "[format('{0}{1}', variables('abbrs').ai.aiHub, parameters('solutionName'))]", - "aiHubFriendlyName": "[variables('aiHubName')]", - "aiHubDescription": "AI Hub for CPS template", - "aiProjectName": "[format('{0}{1}', variables('abbrs').ai.aiHubProject, parameters('solutionName'))]", - "aiProjectFriendlyName": "[variables('aiProjectName')]", + "aiProjectDescription": "AI foundary project for CPS template", + "aiProjectName": "[format('{0}{1}', variables('abbrs').ai.aiFoundryProject, parameters('solutionName'))]", "aiModelDeployments": [ { "name": "[parameters('gptModelName')]", @@ -1221,34 +1205,13 @@ }, "raiPolicyName": "Microsoft.Default" } - ], - "storageNameCleaned": "[replace(variables('storageName'), '-', '')]" + ] }, "resources": [ - { - "type": "Microsoft.MachineLearningServices/workspaces/connections", - "apiVersion": "2024-07-01-preview", - "name": "[format('{0}/{1}', variables('aiHubName'), format('{0}-connection-AzureOpenAI', variables('aiHubName')))]", - "properties": { - "category": "AIServices", - "target": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01').endpoint]", - "authType": "AAD", - "isSharedToAll": true, - "metadata": { - "ApiType": "Azure", - "ResourceId": "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiHubName'))]", - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]", - "aiServicesDeployments" - ] - }, { "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2021-10-01", - "name": "[variables('aiServicesName')]", + "apiVersion": "2025-04-01-preview", + "name": "[variables('aiFoundaryName')]", "location": "[variables('location')]", "identity": { "type": "SystemAssigned" @@ -1258,12 +1221,28 @@ }, "kind": "AIServices", "properties": { - "customSubDomainName": "[variables('aiServicesName')]", - "apiProperties": {}, + "allowProjectManagement": true, + "customSubDomainName": "[variables('aiFoundaryName')]", "publicNetworkAccess": "Enabled", "disableLocalAuth": true } }, + { + "type": "Microsoft.CognitiveServices/accounts/projects", + "apiVersion": "2025-04-01-preview", + "name": "[format('{0}/{1}', variables('aiFoundaryName'), variables('aiProjectName'))]", + "location": "[variables('location')]", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "description": "[variables('aiProjectDescription')]", + "displayName": "[variables('aiProjectName')]" + }, + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiFoundaryName'))]" + ] + }, { "type": "Microsoft.CognitiveServices/accounts", "apiVersion": "2021-10-01", @@ -1278,7 +1257,6 @@ "kind": "AIServices", "properties": { "customSubDomainName": "[variables('aiServicesName_cu')]", - "apiProperties": {}, "publicNetworkAccess": "Enabled", "disableLocalAuth": true } @@ -1292,7 +1270,7 @@ }, "type": "Microsoft.CognitiveServices/accounts/deployments", "apiVersion": "2023-05-01", - "name": "[format('{0}/{1}', variables('aiServicesName'), variables('aiModelDeployments')[copyIndex()].name)]", + "name": "[format('{0}/{1}', variables('aiFoundaryName'), variables('aiModelDeployments')[copyIndex()].name)]", "properties": { "model": { "format": "OpenAI", @@ -1306,124 +1284,26 @@ "capacity": "[variables('aiModelDeployments')[copyIndex()].sku.capacity]" }, "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2022-09-01", - "name": "[variables('storageNameCleaned')]", - "location": "[variables('location')]", - "sku": { - "name": "[variables('storageSkuName')]" - }, - "kind": "StorageV2", - "properties": { - "accessTier": "Hot", - "allowBlobPublicAccess": false, - "allowCrossTenantReplication": false, - "allowSharedKeyAccess": true, - "encryption": { - "keySource": "Microsoft.Storage", - "requireInfrastructureEncryption": false, - "services": { - "blob": { - "enabled": true, - "keyType": "Account" - }, - "file": { - "enabled": true, - "keyType": "Account" - }, - "queue": { - "enabled": true, - "keyType": "Service" - }, - "table": { - "enabled": true, - "keyType": "Service" - } - } - }, - "isHnsEnabled": false, - "isNfsV3Enabled": false, - "keyPolicy": { - "keyExpirationPeriodInDays": 7 - }, - "largeFileSharesState": "Disabled", - "minimumTlsVersion": "TLS1_2", - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Allow" - }, - "supportsHttpsTrafficOnly": true - } - }, - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2022-04-01", - "name": "[guid(resourceGroup().id, parameters('managedIdentityObjectId'), resourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'))]", - "properties": { - "principalId": "[parameters('managedIdentityObjectId')]", - "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", - "principalType": "ServicePrincipal" - } - }, - { - "type": "Microsoft.MachineLearningServices/workspaces", - "apiVersion": "2023-08-01-preview", - "name": "[variables('aiHubName')]", - "location": "[variables('location')]", - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "friendlyName": "[variables('aiHubFriendlyName')]", - "description": "[variables('aiHubDescription')]", - "keyVault": "[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]", - "storageAccount": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleaned'))]", - "applicationInsights": "[parameters('applicationInsightsId')]", - "containerRegistry": "[parameters('containerRegistryId')]" - }, - "kind": "hub", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleaned'))]" - ] - }, - { - "type": "Microsoft.MachineLearningServices/workspaces", - "apiVersion": "2024-01-01-preview", - "name": "[variables('aiProjectName')]", - "location": "[variables('location')]", - "kind": "Project", - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "friendlyName": "[variables('aiProjectFriendlyName')]", - "hubResourceId": "[resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiHubName'))]" - }, - "dependsOn": [ - "[resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiHubName'))]" + "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiFoundaryName'))]" ] } ], "outputs": { "aiServicesTarget": { "type": "string", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01').endpoint]" + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiFoundaryName')), '2025-04-01-preview').endpoint]" }, "aiServicesCUEndpoint": { "type": "string", "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName_cu')), '2021-10-01').endpoint]" }, - "aiServicesName": { + "aiFoundaryName": { "type": "string", - "value": "[variables('aiServicesName')]" + "value": "[variables('aiFoundaryName')]" }, "aiServicesId": { "type": "string", - "value": "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]" + "value": "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiFoundaryName'))]" }, "aiServicesCuId": { "type": "string", @@ -1431,7 +1311,7 @@ }, "aiServicePrincipalId": { "type": "string", - "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName')), '2021-10-01', 'full').identity.principalId]" + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiFoundaryName')), '2025-04-01-preview', 'full').identity.principalId]" }, "aiServiceCuPrincipalId": { "type": "string", @@ -1439,11 +1319,11 @@ }, "aiProjectPrincipalId": { "type": "string", - "value": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiProjectName')), '2024-01-01-preview', 'full').identity.principalId]" + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', variables('aiFoundaryName')), '2025-04-01-preview', 'full').identity.principalId]" }, "aiProjectConnectionString": { "type": "string", - "value": "[format('{0}.api.azureml.ms;{1};{2};{3}', variables('location'), subscription().subscriptionId, resourceGroup().name, variables('aiProjectName'))]" + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts/projects', variables('aiFoundaryName'), variables('aiProjectName')), '2025-04-01-preview').endpoints['AI Foundry API']]" }, "aiProjectName": { "type": "string", @@ -1451,17 +1331,11 @@ }, "aiProjectId": { "type": "string", - "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', variables('aiProjectName'))]" + "value": "[resourceId('Microsoft.CognitiveServices/accounts/projects', variables('aiFoundaryName'), variables('aiProjectName'))]" } } } - }, - "dependsOn": [ - "[resourceId('Microsoft.Resources/deployments', 'deploy_app_insights')]", - "[resourceId('Microsoft.Resources/deployments', 'deploy_container_registry')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault')]", - "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" - ] + } }, { "type": "Microsoft.Resources/deployments", @@ -1487,6 +1361,9 @@ }, "logAnalyticsWorkspaceResourceGroup": { "value": "[reference(resourceId('Microsoft.Resources/deployments', 'deploy_app_insights'), '2022-09-01').outputs.logAnalyticsWorkspaceResourceGroup.value]" + }, + "logAnalyticsWorkspaceSubscription": { + "value": "[reference(resourceId('Microsoft.Resources/deployments', 'deploy_app_insights'), '2022-09-01').outputs.logAnalyticsWorkspaceSubscription.value]" } }, "template": { @@ -1495,8 +1372,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "12849612969576340024" + "version": "0.36.1.42791", + "templateHash": "17443204944330265380" } }, "parameters": { @@ -1514,6 +1391,9 @@ }, "logAnalyticsWorkspaceResourceGroup": { "type": "string" + }, + "logAnalyticsWorkspaceSubscription": { + "type": "string" } }, "resources": [ @@ -1536,8 +1416,8 @@ "appLogsConfiguration": { "destination": "log-analytics", "logAnalyticsConfiguration": { - "customerId": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('logAnalyticsWorkspaceResourceGroup')), 'Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2023-09-01').customerId]", - "sharedKey": "[listKeys(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('logAnalyticsWorkspaceResourceGroup')), 'Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2023-09-01').primarySharedKey]" + "customerId": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', parameters('logAnalyticsWorkspaceSubscription'), parameters('logAnalyticsWorkspaceResourceGroup')), 'Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2023-09-01').customerId]", + "sharedKey": "[listKeys(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', parameters('logAnalyticsWorkspaceSubscription'), parameters('logAnalyticsWorkspaceResourceGroup')), 'Microsoft.OperationalInsights/workspaces', parameters('logAnalyticsWorkspaceName')), '2023-09-01').primarySharedKey]" } }, "zoneRedundant": false, @@ -1625,6 +1505,9 @@ }, "useLocalBuild": { "value": "false" + }, + "imageTag": { + "value": "latest" } }, "template": { @@ -1633,8 +1516,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "6288181929674095968" + "version": "0.36.1.42791", + "templateHash": "9208787367229886695" } }, "parameters": { @@ -1710,6 +1593,9 @@ "useLocalBuild": { "type": "string", "defaultValue": "false" + }, + "imageTag": { + "type": "string" } }, "variables": { @@ -1717,6 +1603,8 @@ "ai": { "aiSearch": "srch-", "aiServices": "aisa-", + "aiFoundry": "aif-", + "aiFoundryProject": "aifp-", "aiVideoIndexer": "avi-", "machineLearningWorkspace": "mlw-", "openAIService": "oai-", @@ -2004,7 +1892,7 @@ "value": "contentprocessor" }, "azureContainerRegistryImageTag": { - "value": "latest" + "value": "[parameters('imageTag')]" }, "managedIdentityId": { "value": "[parameters('containerRegistryReaderId')]" @@ -2036,8 +1924,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "17874244636612129409" + "version": "0.36.1.42791", + "templateHash": "13562163699289922411" } }, "parameters": { @@ -2179,7 +2067,7 @@ "value": "contentprocessorapi" }, "azureContainerRegistryImageTag": { - "value": "latest" + "value": "[parameters('imageTag')]" }, "managedIdentityId": { "value": "[parameters('containerRegistryReaderId')]" @@ -2216,8 +2104,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "17874244636612129409" + "version": "0.36.1.42791", + "templateHash": "13562163699289922411" } }, "parameters": { @@ -2359,7 +2247,7 @@ "value": "contentprocessorweb" }, "azureContainerRegistryImageTag": { - "value": "latest" + "value": "[parameters('imageTag')]" }, "managedIdentityId": { "value": "[parameters('containerRegistryReaderId')]" @@ -2408,8 +2296,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "17874244636612129409" + "version": "0.36.1.42791", + "templateHash": "13562163699289922411" } }, "parameters": { @@ -2592,8 +2480,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "18013369407849007542" + "version": "0.36.1.42791", + "templateHash": "3850312828243192450" } }, "parameters": { @@ -2700,8 +2588,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "12698338841871546352" + "version": "0.36.1.42791", + "templateHash": "10346977865586942127" } }, "parameters": { @@ -2945,8 +2833,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "6748924733076412812" + "version": "0.36.1.42791", + "templateHash": "4418232655579357592" } }, "parameters": { @@ -3148,6 +3036,9 @@ }, "useLocalBuild": { "value": "[variables('useLocalBuildLower')]" + }, + "imageTag": { + "value": "[parameters('imageTag')]" } }, "template": { @@ -3156,8 +3047,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "6288181929674095968" + "version": "0.36.1.42791", + "templateHash": "9208787367229886695" } }, "parameters": { @@ -3233,6 +3124,9 @@ "useLocalBuild": { "type": "string", "defaultValue": "false" + }, + "imageTag": { + "type": "string" } }, "variables": { @@ -3240,6 +3134,8 @@ "ai": { "aiSearch": "srch-", "aiServices": "aisa-", + "aiFoundry": "aif-", + "aiFoundryProject": "aifp-", "aiVideoIndexer": "avi-", "machineLearningWorkspace": "mlw-", "openAIService": "oai-", @@ -3527,7 +3423,7 @@ "value": "contentprocessor" }, "azureContainerRegistryImageTag": { - "value": "latest" + "value": "[parameters('imageTag')]" }, "managedIdentityId": { "value": "[parameters('containerRegistryReaderId')]" @@ -3559,8 +3455,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "17874244636612129409" + "version": "0.36.1.42791", + "templateHash": "13562163699289922411" } }, "parameters": { @@ -3702,7 +3598,7 @@ "value": "contentprocessorapi" }, "azureContainerRegistryImageTag": { - "value": "latest" + "value": "[parameters('imageTag')]" }, "managedIdentityId": { "value": "[parameters('containerRegistryReaderId')]" @@ -3739,8 +3635,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "17874244636612129409" + "version": "0.36.1.42791", + "templateHash": "13562163699289922411" } }, "parameters": { @@ -3882,7 +3778,7 @@ "value": "contentprocessorweb" }, "azureContainerRegistryImageTag": { - "value": "latest" + "value": "[parameters('imageTag')]" }, "managedIdentityId": { "value": "[parameters('containerRegistryReaderId')]" @@ -3931,8 +3827,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.35.1.17967", - "templateHash": "17874244636612129409" + "version": "0.36.1.42791", + "templateHash": "13562163699289922411" } }, "parameters": {