Skip to content

Commit adeea71

Browse files
Remove unused AI Foundry resource configurations and clean up related comments in main.bicep
1 parent 9466a21 commit adeea71

File tree

1 file changed

+4
-242
lines changed

1 file changed

+4
-242
lines changed

infra/main.bicep

Lines changed: 4 additions & 242 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,6 @@ param aiFoundryAiServicesConfiguration aiServicesConfigurationType = {
147147
modelCapacity: 50
148148
}
149149

150-
// @description('Optional. The configuration to apply for the AI Foundry Storage Account resource.')
151-
// param aiFoundryStorageAccountConfiguration storageAccountType = {
152-
// enabled: true
153-
// name: replace('sthub${solutionPrefix}', '-', '')
154-
// location: azureOpenAILocation
155-
// tags: tags
156-
// sku: 'Standard_ZRS'
157-
// subnetResourceId: null //Default value set on module configuration
158-
// }
159-
160-
// @description('Optional. The configuration to apply for the AI Foundry AI Hub resource.')
161-
// param aiFoundryAiHubConfiguration aiHubType = {
162-
// enabled: true
163-
// name: 'aih-${solutionPrefix}'
164-
// location: azureOpenAILocation
165-
// sku: 'Basic'
166-
// tags: tags
167-
// subnetResourceId: null //Default value set on module configuration
168-
// }
169-
170150
@description('Optional. The configuration to apply for the AI Foundry AI Project resource.')
171151
param aiFoundryAiProjectConfiguration aiProjectConfigurationType = {
172152
enabled: true
@@ -802,11 +782,6 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.11.0'
802782
// principalType: 'ServicePrincipal'
803783
// roleDefinitionIdOrName: 'Cognitive Services OpenAI User'
804784
// }
805-
// {
806-
// principalId: containerApp.outputs.?systemAssignedMIPrincipalId!
807-
// principalType: 'ServicePrincipal'
808-
// roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d'
809-
// }
810785
// ]
811786
deployments: aiFoundryAiServicesConfiguration.?deployments ?? [
812787
{
@@ -826,169 +801,11 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.11.0'
826801
}
827802
}
828803

829-
// AI Foundry: storage account
830-
// WAF best practices for Azure Blob Storage: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-blob-storage
831-
// var storageAccountPrivateDnsZones = {
832-
// 'privatelink.blob.${environment().suffixes.storage}': 'blob'
833-
// 'privatelink.file.${environment().suffixes.storage}': 'file'
834-
// }
835-
836-
// module privateDnsZonesAiFoundryStorageAccount 'br/public:avm/res/network/private-dns-zone:0.3.1' = [
837-
// for zone in objectKeys(storageAccountPrivateDnsZones): if (virtualNetworkEnabled && aiFoundryStorageAccountEnabled) {
838-
// name: take(
839-
// 'avm.res.network.private-dns-zone.storage-account.${uniqueString(aiFoundryStorageAccountResourceName,zone)}.${solutionPrefix}',
840-
// 64
841-
// )
842-
// params: {
843-
// name: zone
844-
// tags: tags
845-
// enableTelemetry: enableTelemetry
846-
// virtualNetworkLinks: [
847-
// {
848-
// name: 'vnetlink-${split(zone, '.')[1]}'
849-
// virtualNetworkResourceId: virtualNetwork.outputs.resourceId
850-
// }
851-
// ]
852-
// }
853-
// }
854-
// ]
855-
// var aiFoundryStorageAccountEnabled = aiFoundryStorageAccountConfiguration.?enabled ?? true
856-
// var aiFoundryStorageAccountResourceName = aiFoundryStorageAccountConfiguration.?name ?? replace(
857-
// 'sthub${solutionPrefix}',
858-
// '-',
859-
// ''
860-
// )
861-
862-
// module aiFoundryStorageAccount 'br/public:avm/res/storage/storage-account:0.18.2' = if (aiFoundryStorageAccountEnabled) {
863-
// name: take('avm.res.storage.storage-account.${aiFoundryStorageAccountResourceName}', 64)
864-
// dependsOn: [
865-
// privateDnsZonesAiFoundryStorageAccount
866-
// ]
867-
// params: {
868-
// name: aiFoundryStorageAccountResourceName
869-
// location: aiFoundryStorageAccountConfiguration.?location ?? azureOpenAILocation
870-
// tags: aiFoundryStorageAccountConfiguration.?tags ?? tags
871-
// enableTelemetry: enableTelemetry
872-
// diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceId }]
873-
// skuName: aiFoundryStorageAccountConfiguration.?sku ?? 'Standard_ZRS'
874-
// allowSharedKeyAccess: false
875-
// networkAcls: {
876-
// bypass: 'AzureServices'
877-
// defaultAction: 'Allow'
878-
// }
879-
// blobServices: {
880-
// deleteRetentionPolicyEnabled: false
881-
// containerDeleteRetentionPolicyDays: 7
882-
// containerDeleteRetentionPolicyEnabled: false
883-
// diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceId }]
884-
// }
885-
// publicNetworkAccess: virtualNetworkEnabled ? 'Disabled' : 'Enabled'
886-
// allowBlobPublicAccess: false
887-
// privateEndpoints: virtualNetworkEnabled
888-
// ? map(items(storageAccountPrivateDnsZones), zone => {
889-
// name: 'pep-${zone.value}-${aiFoundryStorageAccountResourceName}'
890-
// customNetworkInterfaceName: 'nic-${zone.value}-${aiFoundryStorageAccountResourceName}'
891-
// service: zone.value
892-
// subnetResourceId: aiFoundryStorageAccountConfiguration.?subnetResourceId ?? virtualNetwork.outputs.subnetResourceIds[0] ?? ''
893-
// privateDnsZoneResourceIds: [resourceId('Microsoft.Network/privateDnsZones', zone.key)]
894-
// })
895-
// : null
896-
// roleAssignments: [
897-
// {
898-
// principalId: userAssignedIdentity.outputs.principalId
899-
// roleDefinitionIdOrName: 'Storage Blob Data Contributor'
900-
// }
901-
// ]
902-
// }
903-
// }
904-
905-
// AI Foundry: AI Hub
906-
// WAF best practices for Open AI: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-openai
907-
// var mlTargetSubResource = 'amlworkspace'
908-
// var mlPrivateDnsZones = {
909-
// 'privatelink.api.azureml.ms': mlTargetSubResource
910-
// 'privatelink.notebooks.azure.net': mlTargetSubResource
911-
// }
912-
// module privateDnsZonesAiFoundryWorkspaceHub 'br/public:avm/res/network/private-dns-zone:0.3.1' = [
913-
// for zone in objectKeys(mlPrivateDnsZones): if (virtualNetworkEnabled && aiFoundryAiHubEnabled) {
914-
// name: take('avm.res.network.private-dns-zone.ai-hub.${uniqueString(aiFoundryAiHubName,zone)}.${solutionPrefix}', 64)
915-
// params: {
916-
// name: zone
917-
// enableTelemetry: enableTelemetry
918-
// tags: tags
919-
// virtualNetworkLinks: [
920-
// {
921-
// name: 'vnetlink-${split(zone, '.')[1]}'
922-
// virtualNetworkResourceId: virtualNetwork.outputs.resourceId
923-
// }
924-
// ]
925-
// }
926-
// }
927-
// ]
928-
// var aiFoundryAiHubEnabled = aiFoundryAiHubConfiguration.?enabled ?? true
929-
// var aiFoundryAiHubName = aiFoundryAiHubConfiguration.?name ?? 'aih-${solutionPrefix}'
930-
// module aiFoundryAiHub 'modules/ai-hub.bicep' = if (aiFoundryAiHubEnabled) {
931-
// name: take('module.ai-hub.${aiFoundryAiHubName}', 64)
932-
// dependsOn: [
933-
// privateDnsZonesAiFoundryWorkspaceHub
934-
// ]
935-
// params: {
936-
// name: aiFoundryAiHubName
937-
// location: aiFoundryAiHubConfiguration.?location ?? azureOpenAILocation
938-
// tags: aiFoundryAiHubConfiguration.?tags ?? tags
939-
// sku: aiFoundryAiHubConfiguration.?sku ?? 'Basic'
940-
// aiFoundryAiServicesName: aiFoundryAiServices.outputs.name
941-
// applicationInsightsResourceId: applicationInsights.outputs.resourceId
942-
// enableTelemetry: enableTelemetry
943-
// logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceId
944-
// storageAccountResourceId: aiFoundryStorageAccount.outputs.resourceId
945-
// virtualNetworkEnabled: virtualNetworkEnabled
946-
// privateEndpoints: virtualNetworkEnabled
947-
// ? [
948-
// {
949-
// name: 'pep-${aiFoundryAiHubName}'
950-
// customNetworkInterfaceName: 'nic-${aiFoundryAiHubName}'
951-
// service: mlTargetSubResource
952-
// subnetResourceId: virtualNetworkEnabled
953-
// ? aiFoundryAiHubConfiguration.?subnetResourceId ?? virtualNetwork.?outputs.?subnetResourceIds[0]
954-
// : null
955-
// privateDnsZoneGroup: {
956-
// privateDnsZoneGroupConfigs: map(objectKeys(mlPrivateDnsZones), zone => {
957-
// name: replace(zone, '.', '-')
958-
// privateDnsZoneResourceId: resourceId('Microsoft.Network/privateDnsZones', zone)
959-
// })
960-
// }
961-
// }
962-
// ]
963-
// : []
964-
// }
965-
// }
966-
967804
// AI Foundry: AI Project
968805
// WAF best practices for Open AI: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-openai
969806
// var aiFoundryAiProjectEnabled = aiFoundryAiProjectConfiguration.?enabled ?? true
970807
var aiFoundryAiProjectName = aiFoundryAiProjectConfiguration.?name ?? 'aifp-${solutionPrefix}'
971-
972-
// module aiFoundryAiProject 'br/public:avm/res/machine-learning-services/workspace:0.12.0' = if (aiFoundryAiProjectEnabled) {
973-
// name: take('avm.res.machine-learning-services.workspace.${aiFoundryAiProjectName}', 64)
974-
// params: {
975-
// name: aiFoundryAiProjectName
976-
// location: aiFoundryAiProjectConfiguration.?location ?? azureOpenAILocation
977-
// tags: aiFoundryAiProjectConfiguration.?tags ?? tags
978-
// enableTelemetry: enableTelemetry
979-
// diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceId }]
980-
// sku: aiFoundryAiProjectConfiguration.?sku ?? 'Basic'
981-
// kind: 'Project'
982-
// hubResourceId: aiFoundryAiHub.outputs.resourceId
983-
// roleAssignments: [
984-
// {
985-
// principalId: containerApp.outputs.?systemAssignedMIPrincipalId!
986-
// // Assigning the role with the role name instead of the role ID freezes the deployment at this point
987-
// roleDefinitionIdOrName: '64702f94-c441-49e6-a78b-ef80e0188fee' //'Azure AI Developer'
988-
// }
989-
// ]
990-
// }
991-
// }
808+
var aiProjectDescription = 'AI Foundry Project'
992809

993810
resource aiServices 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' existing = {
994811
name: aiFoundryAiServicesResourceName
@@ -997,8 +814,6 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' ex
997814
]
998815
}
999816

1000-
var aiProjectDescription = 'AI Foundry Project'
1001-
1002817
resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
1003818
parent: aiServices
1004819
name: aiFoundryAiProjectName
@@ -1047,15 +862,15 @@ resource aiDeveloperAccessFoundry 'Microsoft.Authorization/roleAssignments@2022-
1047862
}
1048863
}
1049864

1050-
resource CognitiveServiceOpenAIUser 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
865+
resource cognitiveServiceOpenAIUser 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
1051866
name: '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'
1052867
}
1053868

1054869
resource cognitiveServiceOpenAIUserAccessFoundry 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
1055-
name: guid(containerApp.name, aiServices.id, CognitiveServiceOpenAIUser.id)
870+
name: guid(containerApp.name, aiServices.id, cognitiveServiceOpenAIUser.id)
1056871
scope: aiServices
1057872
properties: {
1058-
roleDefinitionId: CognitiveServiceOpenAIUser.id
873+
roleDefinitionId: cognitiveServiceOpenAIUser.id
1059874
principalId: containerApp.outputs.?systemAssignedMIPrincipalId!
1060875
}
1061876
}
@@ -1268,11 +1083,6 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
12681083
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
12691084
value: applicationInsights.outputs.connectionString
12701085
}
1271-
{
1272-
name: 'AZURE_AI_AGENT_PROJECT_CONNECTION_STRING'
1273-
value: '${toLower(replace(azureOpenAILocation,' ',''))}.api.azureml.ms;${subscription().subscriptionId};${resourceGroup().name};${aiFoundryAiProjectName}'
1274-
//Location should be the AI Foundry AI Project location
1275-
}
12761086
{
12771087
name: 'AZURE_AI_SUBSCRIPTION_ID'
12781088
value: subscription().subscriptionId
@@ -1809,54 +1619,6 @@ type aiServicesConfigurationType = {
18091619
modelCapacity: int?
18101620
}
18111621

1812-
// @export()
1813-
// @description('The type for the Multi-Agent Custom Automation Engine Storage Account resource configuration.')
1814-
// type storageAccountType = {
1815-
// @description('Optional. If the Storage Account resource should be deployed or not.')
1816-
// enabled: bool?
1817-
1818-
// @description('Optional. The name of the Storage Account resource.')
1819-
// @maxLength(60)
1820-
// name: string?
1821-
1822-
// @description('Optional. Location for the Storage Account resource.')
1823-
// @metadata({ azd: { type: 'location' } })
1824-
// location: string?
1825-
1826-
// @description('Optional. The tags to set for the Storage Account resource.')
1827-
// tags: object?
1828-
1829-
// @description('Optional. The SKU for the Storage Account resource.')
1830-
// sku: ('Standard_LRS' | 'Standard_GRS' | 'Standard_RAGRS' | 'Standard_ZRS' | 'Premium_LRS' | 'Premium_ZRS')?
1831-
1832-
// @description('Optional. The resource Id of the subnet where the Storage Account private endpoint should be created.')
1833-
// subnetResourceId: string?
1834-
// }
1835-
1836-
@export()
1837-
@description('The type for the Multi-Agent Custom Automation Engine AI Hub resource configuration.')
1838-
type aiHubType = {
1839-
@description('Optional. If the AI Hub resource should be deployed or not.')
1840-
enabled: bool?
1841-
1842-
@description('Optional. The name of the AI Hub resource.')
1843-
@maxLength(90)
1844-
name: string?
1845-
1846-
@description('Optional. Location for the AI Hub resource.')
1847-
@metadata({ azd: { type: 'location' } })
1848-
location: string?
1849-
1850-
@description('Optional. The tags to set for the AI Hub resource.')
1851-
tags: object?
1852-
1853-
@description('Optional. The SKU of the AI Hub resource.')
1854-
sku: ('Basic' | 'Free' | 'Standard' | 'Premium')?
1855-
1856-
@description('Optional. The resource Id of the subnet where the AI Hub private endpoint should be created.')
1857-
subnetResourceId: string?
1858-
}
1859-
18601622
@export()
18611623
@description('The type for the Multi-Agent Custom Automation Engine AI Foundry AI Project resource configuration.')
18621624
type aiProjectConfigurationType = {

0 commit comments

Comments
 (0)