From 87ad997699ea57f94cf4389e26f926a675210a47 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Thu, 8 May 2025 12:15:36 +0530 Subject: [PATCH 1/4] bicep update --- infra/abbreviations.json | 361 ++++++++++++------- infra/deploy_ai_foundry.bicep | 16 +- infra/deploy_keyvault.bicep | 2 +- infra/deploy_managed_identity.bicep | 2 +- infra/main.bicep | 17 +- infra/main.json | 533 ++++++++++++++++++++++++++-- 6 files changed, 742 insertions(+), 189 deletions(-) diff --git a/infra/abbreviations.json b/infra/abbreviations.json index 1533dee..93b9565 100644 --- a/infra/abbreviations.json +++ b/infra/abbreviations.json @@ -1,136 +1,227 @@ { - "analysisServicesServers": "as", - "apiManagementService": "apim-", - "appConfigurationStores": "appcs-", - "appManagedEnvironments": "cae-", - "appContainerApps": "ca-", - "authorizationPolicyDefinitions": "policy-", - "automationAutomationAccounts": "aa-", - "blueprintBlueprints": "bp-", - "blueprintBlueprintsArtifacts": "bpa-", - "cacheRedis": "redis-", - "cdnProfiles": "cdnp-", - "cdnProfilesEndpoints": "cdne-", - "cognitiveServicesAccounts": "cog-", - "cognitiveServicesFormRecognizer": "cog-fr-", - "cognitiveServicesTextAnalytics": "cog-ta-", - "computeAvailabilitySets": "avail-", - "computeCloudServices": "cld-", - "computeDiskEncryptionSets": "des", - "computeDisks": "disk", - "computeDisksOs": "osdisk", - "computeGalleries": "gal", - "computeSnapshots": "snap-", - "computeVirtualMachines": "vm", - "computeVirtualMachineScaleSets": "vmss-", - "containerInstanceContainerGroups": "ci", - "containerRegistryRegistries": "cr", - "containerServiceManagedClusters": "aks-", - "databricksWorkspaces": "dbw-", - "dataFactoryFactories": "adf-", - "dataLakeAnalyticsAccounts": "dla", - "dataLakeStoreAccounts": "dls", - "dataMigrationServices": "dms-", - "dBforMySQLServers": "mysql-", - "dBforPostgreSQLServers": "psql-", - "devicesIotHubs": "iot-", - "devicesProvisioningServices": "provs-", - "devicesProvisioningServicesCertificates": "pcert-", - "documentDBDatabaseAccounts": "cosmos-", - "documentDBMongoDatabaseAccounts": "cosmon-", - "eventGridDomains": "evgd-", - "eventGridDomainsTopics": "evgt-", - "eventGridEventSubscriptions": "evgs-", - "eventHubNamespaces": "evhns-", - "eventHubNamespacesEventHubs": "evh-", - "hdInsightClustersHadoop": "hadoop-", - "hdInsightClustersHbase": "hbase-", - "hdInsightClustersKafka": "kafka-", - "hdInsightClustersMl": "mls-", - "hdInsightClustersSpark": "spark-", - "hdInsightClustersStorm": "storm-", - "hybridComputeMachines": "arcs-", - "insightsActionGroups": "ag-", - "insightsComponents": "appi-", - "keyVaultVaults": "kv-", - "kubernetesConnectedClusters": "arck", - "kustoClusters": "dec", - "kustoClustersDatabases": "dedb", - "logicIntegrationAccounts": "ia-", - "logicWorkflows": "logic-", - "machineLearningServicesWorkspaces": "mlw-", - "managedIdentityUserAssignedIdentities": "id-", - "managementManagementGroups": "mg-", - "migrateAssessmentProjects": "migr-", - "networkApplicationGateways": "agw-", - "networkApplicationSecurityGroups": "asg-", - "networkAzureFirewalls": "afw-", - "networkBastionHosts": "bas-", - "networkConnections": "con-", - "networkDnsZones": "dnsz-", - "networkExpressRouteCircuits": "erc-", - "networkFirewallPolicies": "afwp-", - "networkFirewallPoliciesWebApplication": "waf", - "networkFirewallPoliciesRuleGroups": "wafrg", - "networkFrontDoors": "fd-", - "networkFrontdoorWebApplicationFirewallPolicies": "fdfp-", - "networkLoadBalancersExternal": "lbe-", - "networkLoadBalancersInternal": "lbi-", - "networkLoadBalancersInboundNatRules": "rule-", - "networkLocalNetworkGateways": "lgw-", - "networkNatGateways": "ng-", - "networkNetworkInterfaces": "nic-", - "networkNetworkSecurityGroups": "nsg-", - "networkNetworkSecurityGroupsSecurityRules": "nsgsr-", - "networkNetworkWatchers": "nw-", - "networkPrivateDnsZones": "pdnsz-", - "networkPrivateLinkServices": "pl-", - "networkPublicIPAddresses": "pip-", - "networkPublicIPPrefixes": "ippre-", - "networkRouteFilters": "rf-", - "networkRouteTables": "rt-", - "networkRouteTablesRoutes": "udr-", - "networkTrafficManagerProfiles": "traf-", - "networkVirtualNetworkGateways": "vgw-", - "networkVirtualNetworks": "vnet-", - "networkVirtualNetworksSubnets": "snet-", - "networkVirtualNetworksVirtualNetworkPeerings": "peer-", - "networkVirtualWans": "vwan-", - "networkVpnGateways": "vpng-", - "networkVpnGatewaysVpnConnections": "vcn-", - "networkVpnGatewaysVpnSites": "vst-", - "notificationHubsNamespaces": "ntfns-", - "notificationHubsNamespacesNotificationHubs": "ntf-", - "operationalInsightsWorkspaces": "log-", - "portalDashboards": "dash-", - "powerBIDedicatedCapacities": "pbi-", - "purviewAccounts": "pview-", - "recoveryServicesVaults": "rsv-", - "resourcesResourceGroups": "rg-", - "searchSearchServices": "srch-", - "serviceBusNamespaces": "sb-", - "serviceBusNamespacesQueues": "sbq-", - "serviceBusNamespacesTopics": "sbt-", - "serviceEndPointPolicies": "se-", - "serviceFabricClusters": "sf-", - "signalRServiceSignalR": "sigr", - "sqlManagedInstances": "sqlmi-", - "sqlServers": "sql-", - "sqlServersDataWarehouse": "sqldw-", - "sqlServersDatabases": "sqldb-", - "sqlServersDatabasesStretch": "sqlstrdb-", - "storageStorageAccounts": "st", - "storageStorageAccountsVm": "stvm", - "storSimpleManagers": "ssimp", - "streamAnalyticsCluster": "asa-", - "synapseWorkspaces": "syn", - "synapseWorkspacesAnalyticsWorkspaces": "synw", - "synapseWorkspacesSqlPoolsDedicated": "syndp", - "synapseWorkspacesSqlPoolsSpark": "synsp", - "timeSeriesInsightsEnvironments": "tsi-", - "webServerFarms": "plan-", - "webSitesAppService": "app-", - "webSitesAppServiceEnvironment": "ase-", - "webSitesFunctions": "func-", - "webStaticSites": "stapp-" -} + "ai": { + "aiSearch": "srch-", + "aiServices": "aisa-", + "aiVideoIndexer": "avi-", + "machineLearningWorkspace": "mlw-", + "openAIService": "oai-", + "botService": "bot-", + "computerVision": "cv-", + "contentModerator": "cm-", + "contentSafety": "cs-", + "customVisionPrediction": "cstv-", + "customVisionTraining": "cstvt-", + "documentIntelligence": "di-", + "faceApi": "face-", + "healthInsights": "hi-", + "immersiveReader": "ir-", + "languageService": "lang-", + "speechService": "spch-", + "translator": "trsl-", + "aiHub": "aih-", + "aiHubProject": "aihp-" + }, + "analytics": { + "analysisServicesServer": "as", + "databricksWorkspace": "dbw-", + "dataExplorerCluster": "dec", + "dataExplorerClusterDatabase": "dedb", + "dataFactory": "adf-", + "digitalTwin": "dt-", + "streamAnalytics": "asa-", + "synapseAnalyticsPrivateLinkHub": "synplh-", + "synapseAnalyticsSQLDedicatedPool": "syndp", + "synapseAnalyticsSparkPool": "synsp", + "synapseAnalyticsWorkspaces": "synw", + "dataLakeStoreAccount": "dls", + "dataLakeAnalyticsAccount": "dla", + "eventHubsNamespace": "evhns-", + "eventHub": "evh-", + "eventGridDomain": "evgd-", + "eventGridSubscriptions": "evgs-", + "eventGridTopic": "evgt-", + "eventGridSystemTopic": "egst-", + "hdInsightHadoopCluster": "hadoop-", + "hdInsightHBaseCluster": "hbase-", + "hdInsightKafkaCluster": "kafka-", + "hdInsightSparkCluster": "spark-", + "hdInsightStormCluster": "storm-", + "hdInsightMLServicesCluster": "mls-", + "iotHub": "iot-", + "provisioningServices": "provs-", + "provisioningServicesCertificate": "pcert-", + "powerBIEmbedded": "pbi-", + "timeSeriesInsightsEnvironment": "tsi-" + }, + "compute": { + "appServiceEnvironment": "ase-", + "appServicePlan": "asp-", + "loadTesting": "lt-", + "availabilitySet": "avail-", + "arcEnabledServer": "arcs-", + "arcEnabledKubernetesCluster": "arck", + "batchAccounts": "ba-", + "cloudService": "cld-", + "communicationServices": "acs-", + "diskEncryptionSet": "des", + "functionApp": "func-", + "gallery": "gal", + "hostingEnvironment": "host-", + "imageTemplate": "it-", + "managedDiskOS": "osdisk", + "managedDiskData": "disk", + "notificationHubs": "ntf-", + "notificationHubsNamespace": "ntfns-", + "proximityPlacementGroup": "ppg-", + "restorePointCollection": "rpc-", + "snapshot": "snap-", + "staticWebApp": "stapp-", + "virtualMachine": "vm", + "virtualMachineScaleSet": "vmss-", + "virtualMachineMaintenanceConfiguration": "mc-", + "virtualMachineStorageAccount": "stvm", + "webApp": "app-" + }, + "containers": { + "aksCluster": "aks-", + "aksSystemNodePool": "npsystem-", + "aksUserNodePool": "np-", + "containerApp": "ca-", + "containerAppsEnvironment": "cae-", + "containerRegistry": "cr", + "containerInstance": "ci", + "serviceFabricCluster": "sf-", + "serviceFabricManagedCluster": "sfmc-" + }, + "databases": { + "cosmosDBDatabase": "cosmos-", + "cosmosDBApacheCassandra": "coscas-", + "cosmosDBMongoDB": "cosmon-", + "cosmosDBNoSQL": "cosno-", + "cosmosDBTable": "costab-", + "cosmosDBGremlin": "cosgrm-", + "cosmosDBPostgreSQL": "cospos-", + "cacheForRedis": "redis-", + "sqlDatabaseServer": "sql-", + "sqlDatabase": "sqldb-", + "sqlElasticJobAgent": "sqlja-", + "sqlElasticPool": "sqlep-", + "mariaDBServer": "maria-", + "mariaDBDatabase": "mariadb-", + "mySQLDatabase": "mysql-", + "postgreSQLDatabase": "psql-", + "sqlServerStretchDatabase": "sqlstrdb-", + "sqlManagedInstance": "sqlmi-" + }, + "developerTools": { + "appConfigurationStore": "appcs-", + "mapsAccount": "map-", + "signalR": "sigr", + "webPubSub": "wps-" + }, + "devOps": { + "managedGrafana": "amg-" + }, + "integration": { + "apiManagementService": "apim-", + "integrationAccount": "ia-", + "logicApp": "logic-", + "serviceBusNamespace": "sbns-", + "serviceBusQueue": "sbq-", + "serviceBusTopic": "sbt-", + "serviceBusTopicSubscription": "sbts-" + }, + "managementGovernance": { + "automationAccount": "aa-", + "applicationInsights": "appi-", + "monitorActionGroup": "ag-", + "monitorDataCollectionRules": "dcr-", + "monitorAlertProcessingRule": "apr-", + "blueprint": "bp-", + "blueprintAssignment": "bpa-", + "dataCollectionEndpoint": "dce-", + "logAnalyticsWorkspace": "log-", + "logAnalyticsQueryPacks": "pack-", + "managementGroup": "mg-", + "purviewInstance": "pview-", + "resourceGroup": "rg-", + "templateSpecsName": "ts-" + }, + "migration": { + "migrateProject": "migr-", + "databaseMigrationService": "dms-", + "recoveryServicesVault": "rsv-" + }, + "networking": { + "applicationGateway": "agw-", + "applicationSecurityGroup": "asg-", + "cdnProfile": "cdnp-", + "cdnEndpoint": "cdne-", + "connections": "con-", + "dnsForwardingRuleset": "dnsfrs-", + "dnsPrivateResolver": "dnspr-", + "dnsPrivateResolverInboundEndpoint": "in-", + "dnsPrivateResolverOutboundEndpoint": "out-", + "firewall": "afw-", + "firewallPolicy": "afwp-", + "expressRouteCircuit": "erc-", + "expressRouteGateway": "ergw-", + "frontDoorProfile": "afd-", + "frontDoorEndpoint": "fde-", + "frontDoorFirewallPolicy": "fdfp-", + "ipGroups": "ipg-", + "loadBalancerInternal": "lbi-", + "loadBalancerExternal": "lbe-", + "loadBalancerRule": "rule-", + "localNetworkGateway": "lgw-", + "natGateway": "ng-", + "networkInterface": "nic-", + "networkSecurityGroup": "nsg-", + "networkSecurityGroupSecurityRules": "nsgsr-", + "networkWatcher": "nw-", + "privateLink": "pl-", + "privateEndpoint": "pep-", + "publicIPAddress": "pip-", + "publicIPAddressPrefix": "ippre-", + "routeFilter": "rf-", + "routeServer": "rtserv-", + "routeTable": "rt-", + "serviceEndpointPolicy": "se-", + "trafficManagerProfile": "traf-", + "userDefinedRoute": "udr-", + "virtualNetwork": "vnet-", + "virtualNetworkGateway": "vgw-", + "virtualNetworkManager": "vnm-", + "virtualNetworkPeering": "peer-", + "virtualNetworkSubnet": "snet-", + "virtualWAN": "vwan-", + "virtualWANHub": "vhub-" + }, + "security": { + "bastion": "bas-", + "keyVault": "kv-", + "keyVaultManagedHSM": "kvmhsm-", + "managedIdentity": "id-", + "sshKey": "sshkey-", + "vpnGateway": "vpng-", + "vpnConnection": "vcn-", + "vpnSite": "vst-", + "webApplicationFirewallPolicy": "waf", + "webApplicationFirewallPolicyRuleGroup": "wafrg" + }, + "storage": { + "storSimple": "ssimp", + "backupVault": "bvault-", + "backupVaultPolicy": "bkpol-", + "fileShare": "share-", + "storageAccount": "st", + "storageSyncService": "sss-" + }, + "virtualDesktop": { + "labServicesPlan": "lp-", + "virtualDesktopHostPool": "vdpool-", + "virtualDesktopApplicationGroup": "vdag-", + "virtualDesktopWorkspace": "vdws-", + "virtualDesktopScalingPlan": "vdscaling-" + } + } \ No newline at end of file diff --git a/infra/deploy_ai_foundry.bicep b/infra/deploy_ai_foundry.bicep index a38f7d7..13b4efa 100644 --- a/infra/deploy_ai_foundry.bicep +++ b/infra/deploy_ai_foundry.bicep @@ -8,19 +8,19 @@ param managedIdentityObjectId string param aiServicesEndpoint string param aiServicesKey string param aiServicesId string - -var storageName = '${solutionName}hubstorage' +var abbrs = loadJsonContent('./abbreviations.json') +var storageName = '${abbrs.storage.storageAccount}${solutionName}hubst' var storageSkuName = 'Standard_LRS' -var aiServicesName = '${solutionName}-aiservices' -var workspaceName = '${solutionName}-workspace' -var keyvaultName = '${solutionName}-kv' +var aiServicesName = '${abbrs.ai.aiServices}${solutionName}' +var workspaceName = '${abbrs.managementGovernance.logAnalyticsWorkspace}${solutionName}' +var keyvaultName = '${abbrs.security.keyVault}${solutionName}' var location = solutionLocation -var aiHubName = '${solutionName}-aihub' +var aiHubName = '${abbrs.ai.aiHub}${solutionName}' var aiHubFriendlyName = aiHubName var aiHubDescription = 'AI Hub for KM template' -var aiProjectName = '${solutionName}-aiproject' +var aiProjectName = '${abbrs.ai.aiHubProject}${solutionName}' var aiProjectFriendlyName = aiProjectName -var aiSearchName = '${solutionName}-search' +var aiSearchName = '${abbrs.ai.aiSearch}${solutionName}' resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { diff --git a/infra/deploy_keyvault.bicep b/infra/deploy_keyvault.bicep index 5222a9f..0ac0018 100644 --- a/infra/deploy_keyvault.bicep +++ b/infra/deploy_keyvault.bicep @@ -5,7 +5,7 @@ param solutionName string param solutionLocation string param managedIdentityObjectId string -var keyvaultName = '${solutionName}-kv' +param keyvaultName string resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { name: keyvaultName diff --git a/infra/deploy_managed_identity.bicep b/infra/deploy_managed_identity.bicep index a6a331b..5af3232 100644 --- a/infra/deploy_managed_identity.bicep +++ b/infra/deploy_managed_identity.bicep @@ -10,7 +10,7 @@ param solutionName string param solutionLocation string @description('Name') -param miName string = '${ solutionName }-managed-identity' +param miName string resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { name: miName diff --git a/infra/main.bicep b/infra/main.bicep index fc1f9f6..03dc951 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -2,6 +2,7 @@ @maxLength(10) @description('Prefix for all resources created by this template. This prefix will be used to create unique names for all resources. The prefix must be unique within the resource group.') param ResourcePrefix string +var abbrs = loadJsonContent('./abbreviations.json') @allowed([ 'australiaeast' @@ -58,9 +59,9 @@ var containerName = 'appstorage' var llmModel = 'gpt-4o' var prefixCleaned = replace(toLower(finalName), '-', '') var storageSkuName = 'Standard_LRS' -var storageContainerName = '${prefixCleaned}ctstor' +var storageContainerName = '${abbrs.storage.storageAccount}${prefixCleaned}' var gptModelVersion = '2024-08-06' -var aiServicesName = '${prefixCleaned}-aiservices' +var aiServicesName = '${abbrs.ai.aiServices}${prefixCleaned}' @@ -87,7 +88,7 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = properties: { customSubDomainName: aiServicesName apiProperties: { - statisticsEnabled: false + // statisticsEnabled: false } } } @@ -116,6 +117,7 @@ resource aiServicesDeployments 'Microsoft.CognitiveServices/accounts/deployments module managedIdentityModule 'deploy_managed_identity.bicep' = { name: 'deploy_managed_identity' params: { + miName:'${abbrs.security.managedIdentity}${prefixCleaned}' solutionName: prefixCleaned solutionLocation: location } @@ -127,6 +129,7 @@ module managedIdentityModule 'deploy_managed_identity.bicep' = { module kvault 'deploy_keyvault.bicep' = { name: 'deploy_keyvault' params: { + keyvaultName: '${abbrs.security.keyVault}${prefixCleaned}' solutionName: prefixCleaned solutionLocation: location managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId @@ -167,7 +170,7 @@ module databaseAccount 'br/public:avm/res/document-db/database-account:0.9.0' = name: toLower('${prefixCleaned}database') params: { // Required parameters - name: toLower('${prefixCleaned}databaseAccount') + name: toLower('${abbrs.databases.cosmosDBDatabase}${prefixCleaned}databaseAccount') // Non-required parameters enableAnalyticalStorage: true location: dblocation @@ -231,7 +234,7 @@ module databaseAccount 'br/public:avm/res/document-db/database-account:0.9.0' = } module containerAppFrontend 'br/public:avm/res/app/container-app:0.13.0' = { - name: toLower('${prefixCleaned}containerAppFrontend') + name: toLower('${abbrs.containers.containerApp}${prefixCleaned}containerAppFrontend') params: { managedIdentities: { systemAssigned: true @@ -261,7 +264,7 @@ module containerAppFrontend 'br/public:avm/res/app/container-app:0.13.0' = { scaleMinReplicas: 1 scaleMaxReplicas: 1 environmentResourceId: containerAppsEnvironment.outputs.resourceId - name: toLower('${prefixCleaned}containerFrontend') + name: toLower('${abbrs.containers.containerApp}${prefixCleaned}containerFrontend') // Non-required parameters location: location } @@ -269,7 +272,7 @@ module containerAppFrontend 'br/public:avm/res/app/container-app:0.13.0' = { resource containerAppBackend 'Microsoft.App/containerApps@2023-05-01' = { - name: toLower('${prefixCleaned}containerBackend') + name: toLower('${abbrs.containers.containerApp}${prefixCleaned}containerBackend') location: location identity: { type: 'SystemAssigned' diff --git a/infra/main.json b/infra/main.json index 24ab22f..75e1a88 100644 --- a/infra/main.json +++ b/infra/main.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.33.93.31351", - "templateHash": "11802129812634129151" + "templateHash": "9645396053164913156" } }, "parameters": { @@ -54,6 +54,234 @@ } }, "variables": { + "$fxv#0": { + "ai": { + "aiSearch": "srch-", + "aiServices": "aisa-", + "aiVideoIndexer": "avi-", + "machineLearningWorkspace": "mlw-", + "openAIService": "oai-", + "botService": "bot-", + "computerVision": "cv-", + "contentModerator": "cm-", + "contentSafety": "cs-", + "customVisionPrediction": "cstv-", + "customVisionTraining": "cstvt-", + "documentIntelligence": "di-", + "faceApi": "face-", + "healthInsights": "hi-", + "immersiveReader": "ir-", + "languageService": "lang-", + "speechService": "spch-", + "translator": "trsl-", + "aiHub": "aih-", + "aiHubProject": "aihp-" + }, + "analytics": { + "analysisServicesServer": "as", + "databricksWorkspace": "dbw-", + "dataExplorerCluster": "dec", + "dataExplorerClusterDatabase": "dedb", + "dataFactory": "adf-", + "digitalTwin": "dt-", + "streamAnalytics": "asa-", + "synapseAnalyticsPrivateLinkHub": "synplh-", + "synapseAnalyticsSQLDedicatedPool": "syndp", + "synapseAnalyticsSparkPool": "synsp", + "synapseAnalyticsWorkspaces": "synw", + "dataLakeStoreAccount": "dls", + "dataLakeAnalyticsAccount": "dla", + "eventHubsNamespace": "evhns-", + "eventHub": "evh-", + "eventGridDomain": "evgd-", + "eventGridSubscriptions": "evgs-", + "eventGridTopic": "evgt-", + "eventGridSystemTopic": "egst-", + "hdInsightHadoopCluster": "hadoop-", + "hdInsightHBaseCluster": "hbase-", + "hdInsightKafkaCluster": "kafka-", + "hdInsightSparkCluster": "spark-", + "hdInsightStormCluster": "storm-", + "hdInsightMLServicesCluster": "mls-", + "iotHub": "iot-", + "provisioningServices": "provs-", + "provisioningServicesCertificate": "pcert-", + "powerBIEmbedded": "pbi-", + "timeSeriesInsightsEnvironment": "tsi-" + }, + "compute": { + "appServiceEnvironment": "ase-", + "appServicePlan": "asp-", + "loadTesting": "lt-", + "availabilitySet": "avail-", + "arcEnabledServer": "arcs-", + "arcEnabledKubernetesCluster": "arck", + "batchAccounts": "ba-", + "cloudService": "cld-", + "communicationServices": "acs-", + "diskEncryptionSet": "des", + "functionApp": "func-", + "gallery": "gal", + "hostingEnvironment": "host-", + "imageTemplate": "it-", + "managedDiskOS": "osdisk", + "managedDiskData": "disk", + "notificationHubs": "ntf-", + "notificationHubsNamespace": "ntfns-", + "proximityPlacementGroup": "ppg-", + "restorePointCollection": "rpc-", + "snapshot": "snap-", + "staticWebApp": "stapp-", + "virtualMachine": "vm", + "virtualMachineScaleSet": "vmss-", + "virtualMachineMaintenanceConfiguration": "mc-", + "virtualMachineStorageAccount": "stvm", + "webApp": "app-" + }, + "containers": { + "aksCluster": "aks-", + "aksSystemNodePool": "npsystem-", + "aksUserNodePool": "np-", + "containerApp": "ca-", + "containerAppsEnvironment": "cae-", + "containerRegistry": "cr", + "containerInstance": "ci", + "serviceFabricCluster": "sf-", + "serviceFabricManagedCluster": "sfmc-" + }, + "databases": { + "cosmosDBDatabase": "cosmos-", + "cosmosDBApacheCassandra": "coscas-", + "cosmosDBMongoDB": "cosmon-", + "cosmosDBNoSQL": "cosno-", + "cosmosDBTable": "costab-", + "cosmosDBGremlin": "cosgrm-", + "cosmosDBPostgreSQL": "cospos-", + "cacheForRedis": "redis-", + "sqlDatabaseServer": "sql-", + "sqlDatabase": "sqldb-", + "sqlElasticJobAgent": "sqlja-", + "sqlElasticPool": "sqlep-", + "mariaDBServer": "maria-", + "mariaDBDatabase": "mariadb-", + "mySQLDatabase": "mysql-", + "postgreSQLDatabase": "psql-", + "sqlServerStretchDatabase": "sqlstrdb-", + "sqlManagedInstance": "sqlmi-" + }, + "developerTools": { + "appConfigurationStore": "appcs-", + "mapsAccount": "map-", + "signalR": "sigr", + "webPubSub": "wps-" + }, + "devOps": { + "managedGrafana": "amg-" + }, + "integration": { + "apiManagementService": "apim-", + "integrationAccount": "ia-", + "logicApp": "logic-", + "serviceBusNamespace": "sbns-", + "serviceBusQueue": "sbq-", + "serviceBusTopic": "sbt-", + "serviceBusTopicSubscription": "sbts-" + }, + "managementGovernance": { + "automationAccount": "aa-", + "applicationInsights": "appi-", + "monitorActionGroup": "ag-", + "monitorDataCollectionRules": "dcr-", + "monitorAlertProcessingRule": "apr-", + "blueprint": "bp-", + "blueprintAssignment": "bpa-", + "dataCollectionEndpoint": "dce-", + "logAnalyticsWorkspace": "log-", + "logAnalyticsQueryPacks": "pack-", + "managementGroup": "mg-", + "purviewInstance": "pview-", + "resourceGroup": "rg-", + "templateSpecsName": "ts-" + }, + "migration": { + "migrateProject": "migr-", + "databaseMigrationService": "dms-", + "recoveryServicesVault": "rsv-" + }, + "networking": { + "applicationGateway": "agw-", + "applicationSecurityGroup": "asg-", + "cdnProfile": "cdnp-", + "cdnEndpoint": "cdne-", + "connections": "con-", + "dnsForwardingRuleset": "dnsfrs-", + "dnsPrivateResolver": "dnspr-", + "dnsPrivateResolverInboundEndpoint": "in-", + "dnsPrivateResolverOutboundEndpoint": "out-", + "firewall": "afw-", + "firewallPolicy": "afwp-", + "expressRouteCircuit": "erc-", + "expressRouteGateway": "ergw-", + "frontDoorProfile": "afd-", + "frontDoorEndpoint": "fde-", + "frontDoorFirewallPolicy": "fdfp-", + "ipGroups": "ipg-", + "loadBalancerInternal": "lbi-", + "loadBalancerExternal": "lbe-", + "loadBalancerRule": "rule-", + "localNetworkGateway": "lgw-", + "natGateway": "ng-", + "networkInterface": "nic-", + "networkSecurityGroup": "nsg-", + "networkSecurityGroupSecurityRules": "nsgsr-", + "networkWatcher": "nw-", + "privateLink": "pl-", + "privateEndpoint": "pep-", + "publicIPAddress": "pip-", + "publicIPAddressPrefix": "ippre-", + "routeFilter": "rf-", + "routeServer": "rtserv-", + "routeTable": "rt-", + "serviceEndpointPolicy": "se-", + "trafficManagerProfile": "traf-", + "userDefinedRoute": "udr-", + "virtualNetwork": "vnet-", + "virtualNetworkGateway": "vgw-", + "virtualNetworkManager": "vnm-", + "virtualNetworkPeering": "peer-", + "virtualNetworkSubnet": "snet-", + "virtualWAN": "vwan-", + "virtualWANHub": "vhub-" + }, + "security": { + "bastion": "bas-", + "keyVault": "kv-", + "keyVaultManagedHSM": "kvmhsm-", + "managedIdentity": "id-", + "sshKey": "sshkey-", + "vpnGateway": "vpng-", + "vpnConnection": "vcn-", + "vpnSite": "vst-", + "webApplicationFirewallPolicy": "waf", + "webApplicationFirewallPolicyRuleGroup": "wafrg" + }, + "storage": { + "storSimple": "ssimp", + "backupVault": "bvault-", + "backupVaultPolicy": "bkpol-", + "fileShare": "share-", + "storageAccount": "st", + "storageSyncService": "sss-" + }, + "virtualDesktop": { + "labServicesPlan": "lp-", + "virtualDesktopHostPool": "vdpool-", + "virtualDesktopApplicationGroup": "vdag-", + "virtualDesktopWorkspace": "vdws-", + "virtualDesktopScalingPlan": "vdscaling-" + } + }, + "abbrs": "[variables('$fxv#0')]", "randomString": "[substring(uniqueString(resourceGroup().id), 0, 4)]", "finalName": "[format('{0}-{1}', parameters('ResourcePrefix'), variables('randomString'))]", "imageVersion": "rc1", @@ -68,9 +296,9 @@ "llmModel": "gpt-4o", "prefixCleaned": "[replace(toLower(variables('finalName')), '-', '')]", "storageSkuName": "Standard_LRS", - "storageContainerName": "[format('{0}ctstor', variables('prefixCleaned'))]", + "storageContainerName": "[format('{0}{1}', variables('abbrs').storage.storageAccount, variables('prefixCleaned'))]", "gptModelVersion": "2024-08-06", - "aiServicesName": "[format('{0}-aiservices', variables('prefixCleaned'))]", + "aiServicesName": "[format('{0}{1}', variables('abbrs').ai.aiServices, variables('prefixCleaned'))]", "aiModelDeployments": [ { "name": "[variables('llmModel')]", @@ -100,9 +328,7 @@ "kind": "AIServices", "properties": { "customSubDomainName": "[variables('aiServicesName')]", - "apiProperties": { - "statisticsEnabled": false - } + "apiProperties": {} } }, { @@ -134,7 +360,7 @@ { "type": "Microsoft.App/containerApps", "apiVersion": "2023-05-01", - "name": "[toLower(format('{0}containerBackend', variables('prefixCleaned')))]", + "name": "[toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))]", "location": "[variables('location')]", "identity": { "type": "SystemAssigned" @@ -290,13 +516,13 @@ "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2022-04-01", "scope": "[format('Microsoft.Storage/storageAccounts/{0}', variables('storageContainerName'))]", - "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), 'Storage Blob Data Contributor')]", + "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), 'Storage Blob Data Contributor')]", "properties": { "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", - "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId]" + "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId]" }, "dependsOn": [ - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned'))))]", + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('storageContainerName'))]" ] }, @@ -304,14 +530,14 @@ "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2022-04-01", "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', variables('aiServicesName'))]", - "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), variables('openAiContributorRoleId'))]", + "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), variables('openAiContributorRoleId'))]", "properties": { "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', variables('openAiContributorRoleId'))]", - "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId]" + "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId]" }, "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]", - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned'))))]" + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]" ] }, { @@ -340,6 +566,9 @@ }, "mode": "Incremental", "parameters": { + "miName": { + "value": "[format('{0}{1}', variables('abbrs').security.managedIdentity, variables('prefixCleaned'))]" + }, "solutionName": { "value": "[variables('prefixCleaned')]" }, @@ -354,7 +583,7 @@ "_generator": { "name": "bicep", "version": "0.33.93.31351", - "templateHash": "11665286146084422127" + "templateHash": "4801202077166882355" } }, "parameters": { @@ -374,7 +603,6 @@ }, "miName": { "type": "string", - "defaultValue": "[format('{0}-managed-identity', parameters('solutionName'))]", "metadata": { "description": "Name" } @@ -435,6 +663,9 @@ }, "mode": "Incremental", "parameters": { + "keyvaultName": { + "value": "[format('{0}{1}', variables('abbrs').security.keyVault, variables('prefixCleaned'))]" + }, "solutionName": { "value": "[variables('prefixCleaned')]" }, @@ -452,7 +683,7 @@ "_generator": { "name": "bicep", "version": "0.33.93.31351", - "templateHash": "4388214478635448075" + "templateHash": "15626032116057754317" } }, "parameters": { @@ -469,16 +700,16 @@ }, "managedIdentityObjectId": { "type": "string" + }, + "keyvaultName": { + "type": "string" } }, - "variables": { - "keyvaultName": "[format('{0}-kv', parameters('solutionName'))]" - }, "resources": [ { "type": "Microsoft.KeyVault/vaults", "apiVersion": "2022-07-01", - "name": "[variables('keyvaultName')]", + "name": "[parameters('keyvaultName')]", "location": "[parameters('solutionLocation')]", "properties": { "createMode": "default", @@ -531,11 +762,11 @@ "outputs": { "keyvaultName": { "type": "string", - "value": "[variables('keyvaultName')]" + "value": "[parameters('keyvaultName')]" }, "keyvaultId": { "type": "string", - "value": "[resourceId('Microsoft.KeyVault/vaults', variables('keyvaultName'))]" + "value": "[resourceId('Microsoft.KeyVault/vaults', parameters('keyvaultName'))]" } } } @@ -590,7 +821,7 @@ "_generator": { "name": "bicep", "version": "0.33.93.31351", - "templateHash": "10270252950808398257" + "templateHash": "17234510752657929213" } }, "parameters": { @@ -623,18 +854,246 @@ } }, "variables": { - "storageName": "[format('{0}hubstorage', parameters('solutionName'))]", + "$fxv#0": { + "ai": { + "aiSearch": "srch-", + "aiServices": "aisa-", + "aiVideoIndexer": "avi-", + "machineLearningWorkspace": "mlw-", + "openAIService": "oai-", + "botService": "bot-", + "computerVision": "cv-", + "contentModerator": "cm-", + "contentSafety": "cs-", + "customVisionPrediction": "cstv-", + "customVisionTraining": "cstvt-", + "documentIntelligence": "di-", + "faceApi": "face-", + "healthInsights": "hi-", + "immersiveReader": "ir-", + "languageService": "lang-", + "speechService": "spch-", + "translator": "trsl-", + "aiHub": "aih-", + "aiHubProject": "aihp-" + }, + "analytics": { + "analysisServicesServer": "as", + "databricksWorkspace": "dbw-", + "dataExplorerCluster": "dec", + "dataExplorerClusterDatabase": "dedb", + "dataFactory": "adf-", + "digitalTwin": "dt-", + "streamAnalytics": "asa-", + "synapseAnalyticsPrivateLinkHub": "synplh-", + "synapseAnalyticsSQLDedicatedPool": "syndp", + "synapseAnalyticsSparkPool": "synsp", + "synapseAnalyticsWorkspaces": "synw", + "dataLakeStoreAccount": "dls", + "dataLakeAnalyticsAccount": "dla", + "eventHubsNamespace": "evhns-", + "eventHub": "evh-", + "eventGridDomain": "evgd-", + "eventGridSubscriptions": "evgs-", + "eventGridTopic": "evgt-", + "eventGridSystemTopic": "egst-", + "hdInsightHadoopCluster": "hadoop-", + "hdInsightHBaseCluster": "hbase-", + "hdInsightKafkaCluster": "kafka-", + "hdInsightSparkCluster": "spark-", + "hdInsightStormCluster": "storm-", + "hdInsightMLServicesCluster": "mls-", + "iotHub": "iot-", + "provisioningServices": "provs-", + "provisioningServicesCertificate": "pcert-", + "powerBIEmbedded": "pbi-", + "timeSeriesInsightsEnvironment": "tsi-" + }, + "compute": { + "appServiceEnvironment": "ase-", + "appServicePlan": "asp-", + "loadTesting": "lt-", + "availabilitySet": "avail-", + "arcEnabledServer": "arcs-", + "arcEnabledKubernetesCluster": "arck", + "batchAccounts": "ba-", + "cloudService": "cld-", + "communicationServices": "acs-", + "diskEncryptionSet": "des", + "functionApp": "func-", + "gallery": "gal", + "hostingEnvironment": "host-", + "imageTemplate": "it-", + "managedDiskOS": "osdisk", + "managedDiskData": "disk", + "notificationHubs": "ntf-", + "notificationHubsNamespace": "ntfns-", + "proximityPlacementGroup": "ppg-", + "restorePointCollection": "rpc-", + "snapshot": "snap-", + "staticWebApp": "stapp-", + "virtualMachine": "vm", + "virtualMachineScaleSet": "vmss-", + "virtualMachineMaintenanceConfiguration": "mc-", + "virtualMachineStorageAccount": "stvm", + "webApp": "app-" + }, + "containers": { + "aksCluster": "aks-", + "aksSystemNodePool": "npsystem-", + "aksUserNodePool": "np-", + "containerApp": "ca-", + "containerAppsEnvironment": "cae-", + "containerRegistry": "cr", + "containerInstance": "ci", + "serviceFabricCluster": "sf-", + "serviceFabricManagedCluster": "sfmc-" + }, + "databases": { + "cosmosDBDatabase": "cosmos-", + "cosmosDBApacheCassandra": "coscas-", + "cosmosDBMongoDB": "cosmon-", + "cosmosDBNoSQL": "cosno-", + "cosmosDBTable": "costab-", + "cosmosDBGremlin": "cosgrm-", + "cosmosDBPostgreSQL": "cospos-", + "cacheForRedis": "redis-", + "sqlDatabaseServer": "sql-", + "sqlDatabase": "sqldb-", + "sqlElasticJobAgent": "sqlja-", + "sqlElasticPool": "sqlep-", + "mariaDBServer": "maria-", + "mariaDBDatabase": "mariadb-", + "mySQLDatabase": "mysql-", + "postgreSQLDatabase": "psql-", + "sqlServerStretchDatabase": "sqlstrdb-", + "sqlManagedInstance": "sqlmi-" + }, + "developerTools": { + "appConfigurationStore": "appcs-", + "mapsAccount": "map-", + "signalR": "sigr", + "webPubSub": "wps-" + }, + "devOps": { + "managedGrafana": "amg-" + }, + "integration": { + "apiManagementService": "apim-", + "integrationAccount": "ia-", + "logicApp": "logic-", + "serviceBusNamespace": "sbns-", + "serviceBusQueue": "sbq-", + "serviceBusTopic": "sbt-", + "serviceBusTopicSubscription": "sbts-" + }, + "managementGovernance": { + "automationAccount": "aa-", + "applicationInsights": "appi-", + "monitorActionGroup": "ag-", + "monitorDataCollectionRules": "dcr-", + "monitorAlertProcessingRule": "apr-", + "blueprint": "bp-", + "blueprintAssignment": "bpa-", + "dataCollectionEndpoint": "dce-", + "logAnalyticsWorkspace": "log-", + "logAnalyticsQueryPacks": "pack-", + "managementGroup": "mg-", + "purviewInstance": "pview-", + "resourceGroup": "rg-", + "templateSpecsName": "ts-" + }, + "migration": { + "migrateProject": "migr-", + "databaseMigrationService": "dms-", + "recoveryServicesVault": "rsv-" + }, + "networking": { + "applicationGateway": "agw-", + "applicationSecurityGroup": "asg-", + "cdnProfile": "cdnp-", + "cdnEndpoint": "cdne-", + "connections": "con-", + "dnsForwardingRuleset": "dnsfrs-", + "dnsPrivateResolver": "dnspr-", + "dnsPrivateResolverInboundEndpoint": "in-", + "dnsPrivateResolverOutboundEndpoint": "out-", + "firewall": "afw-", + "firewallPolicy": "afwp-", + "expressRouteCircuit": "erc-", + "expressRouteGateway": "ergw-", + "frontDoorProfile": "afd-", + "frontDoorEndpoint": "fde-", + "frontDoorFirewallPolicy": "fdfp-", + "ipGroups": "ipg-", + "loadBalancerInternal": "lbi-", + "loadBalancerExternal": "lbe-", + "loadBalancerRule": "rule-", + "localNetworkGateway": "lgw-", + "natGateway": "ng-", + "networkInterface": "nic-", + "networkSecurityGroup": "nsg-", + "networkSecurityGroupSecurityRules": "nsgsr-", + "networkWatcher": "nw-", + "privateLink": "pl-", + "privateEndpoint": "pep-", + "publicIPAddress": "pip-", + "publicIPAddressPrefix": "ippre-", + "routeFilter": "rf-", + "routeServer": "rtserv-", + "routeTable": "rt-", + "serviceEndpointPolicy": "se-", + "trafficManagerProfile": "traf-", + "userDefinedRoute": "udr-", + "virtualNetwork": "vnet-", + "virtualNetworkGateway": "vgw-", + "virtualNetworkManager": "vnm-", + "virtualNetworkPeering": "peer-", + "virtualNetworkSubnet": "snet-", + "virtualWAN": "vwan-", + "virtualWANHub": "vhub-" + }, + "security": { + "bastion": "bas-", + "keyVault": "kv-", + "keyVaultManagedHSM": "kvmhsm-", + "managedIdentity": "id-", + "sshKey": "sshkey-", + "vpnGateway": "vpng-", + "vpnConnection": "vcn-", + "vpnSite": "vst-", + "webApplicationFirewallPolicy": "waf", + "webApplicationFirewallPolicyRuleGroup": "wafrg" + }, + "storage": { + "storSimple": "ssimp", + "backupVault": "bvault-", + "backupVaultPolicy": "bkpol-", + "fileShare": "share-", + "storageAccount": "st", + "storageSyncService": "sss-" + }, + "virtualDesktop": { + "labServicesPlan": "lp-", + "virtualDesktopHostPool": "vdpool-", + "virtualDesktopApplicationGroup": "vdag-", + "virtualDesktopWorkspace": "vdws-", + "virtualDesktopScalingPlan": "vdscaling-" + } + }, + "abbrs": "[variables('$fxv#0')]", + "storageName": "[format('{0}{1}hubst', variables('abbrs').storage.storageAccount, parameters('solutionName'))]", "storageSkuName": "Standard_LRS", - "aiServicesName": "[format('{0}-aiservices', parameters('solutionName'))]", - "workspaceName": "[format('{0}-workspace', parameters('solutionName'))]", - "keyvaultName": "[format('{0}-kv', parameters('solutionName'))]", + "aiServicesName": "[format('{0}{1}', variables('abbrs').ai.aiServices, parameters('solutionName'))]", + "workspaceName": "[format('{0}{1}', variables('abbrs').managementGovernance.logAnalyticsWorkspace, parameters('solutionName'))]", + "keyvaultName": "[format('{0}{1}', variables('abbrs').security.keyVault, parameters('solutionName'))]", "location": "[parameters('solutionLocation')]", - "aiHubName": "[format('{0}-aihub', parameters('solutionName'))]", + "aiHubName": "[format('{0}{1}', variables('abbrs').ai.aiHub, parameters('solutionName'))]", "aiHubFriendlyName": "[variables('aiHubName')]", "aiHubDescription": "AI Hub for KM template", - "aiProjectName": "[format('{0}-aiproject', parameters('solutionName'))]", + "aiProjectName": "[format('{0}{1}', variables('abbrs').ai.aiHubProject, parameters('solutionName'))]", "aiProjectFriendlyName": "[variables('aiProjectName')]", - "aiSearchName": "[format('{0}-search', parameters('solutionName'))]", + "aiSearchName": "[format('{0}{1}', variables('abbrs').ai.aiSearch, parameters('solutionName'))]", "storageNameCleaned": "[replace(variables('storageName'), '-', '')]" }, "resources": [ @@ -1579,7 +2038,7 @@ "mode": "Incremental", "parameters": { "name": { - "value": "[toLower(format('{0}databaseAccount', variables('prefixCleaned')))]" + "value": "[toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('prefixCleaned')))]" }, "enableAnalyticalStorage": { "value": true @@ -5387,7 +5846,7 @@ { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", - "name": "[toLower(format('{0}containerAppFrontend', variables('prefixCleaned')))]", + "name": "[toLower(format('{0}{1}containerAppFrontend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -5408,7 +5867,7 @@ "env": [ { "name": "API_URL", - "value": "[format('https://{0}', reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01').configuration.ingress.fqdn)]" + "value": "[format('https://{0}', reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01').configuration.ingress.fqdn)]" } ], "image": "[format('cmsacontainerreg.azurecr.io/cmsafrontend:{0}', variables('imageVersion'))]", @@ -5436,7 +5895,7 @@ "value": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value]" }, "name": { - "value": "[toLower(format('{0}containerFrontend', variables('prefixCleaned')))]" + "value": "[toLower(format('{0}{1}containerFrontend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))]" }, "location": { "value": "[variables('location')]" @@ -6608,7 +7067,7 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned'))))]", + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]", "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned'))))]", "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" ] @@ -6643,7 +7102,7 @@ } }, "scriptContent": { - "value": "[format('az cosmosdb sql role assignment create --resource-group \"{0}\" --account-name \"{1}\" --role-definition-id \"{2}\" --scope \"{3}\" --principal-id \"{4}\"', resourceGroup().name, reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.name.value, resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[0], split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[1]), reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value, reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId)]" + "value": "[format('az cosmosdb sql role assignment create --resource-group \"{0}\" --account-name \"{1}\" --role-definition-id \"{2}\" --scope \"{3}\" --principal-id \"{4}\"', resourceGroup().name, reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.name.value, resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[0], split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[1]), reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value, reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId)]" } }, "template": { @@ -7172,7 +7631,7 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}containerBackend', variables('prefixCleaned'))))]", + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]", "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned'))))]", "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" ] From 67a5839de0e21132f60283ba698477223d7e8648 Mon Sep 17 00:00:00 2001 From: Prasanjeet-Microsoft Date: Thu, 8 May 2025 22:26:34 +0530 Subject: [PATCH 2/4] added .dockerignore file to exclude unnecessary files from Docker build context --- .dockerignore | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..68dc843 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,162 @@ +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/engine/reference/builder/#dockerignore-file + +**/.DS_Store +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/*.Dockerfile +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.log + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# VS Code +.vscode/ + +# Ignore other unnecessary files +*.bak +*.swp +.DS_Store +*.pdb +*.sqlite3 From 5fa7db7f3fb2e6ee39f4fdb22bb2286f21a254b5 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 21 May 2025 12:29:19 +0530 Subject: [PATCH 3/4] workingbicep --- infra/deploy_ai_foundry.bicep | 10 +++---- infra/main.bicep | 53 +++++++++++------------------------ 2 files changed, 21 insertions(+), 42 deletions(-) diff --git a/infra/deploy_ai_foundry.bicep b/infra/deploy_ai_foundry.bicep index 9783fee..11f49e5 100644 --- a/infra/deploy_ai_foundry.bicep +++ b/infra/deploy_ai_foundry.bicep @@ -11,23 +11,23 @@ param managedIdentityObjectId string param aiServicesEndpoint string param aiServicesKey string param aiServicesId string - var abbrs = loadJsonContent('./abbreviations.json') -var storageName = '${abbrs.storage.storageAccount}${solutionName}hubst' + +var storageName = '${abbrs.storage.storageAccount}${solutionName}' + var storageSkuName = 'Standard_LRS' var aiServicesName = '${abbrs.ai.aiServices}${solutionName}' var workspaceName = '${abbrs.managementGovernance.logAnalyticsWorkspace}${solutionName}' var keyvaultName = '${abbrs.security.keyVault}${solutionName}' var location = solutionLocation -var aiHubName = '${abbrs.ai.aiHub}${solutionName}' -var aiHubFriendlyName = aiHubName +var azureAiHubName = '${abbrs.ai.aiHub}${solutionName}' +var aiHubFriendlyName = azureAiHubName var aiHubDescription = 'AI Hub for KM template' var aiProjectName = '${abbrs.ai.aiHubProject}${solutionName}' var aiProjectFriendlyName = aiProjectName var aiSearchName = '${abbrs.ai.aiSearch}${solutionName}' - resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { name: keyVaultName } diff --git a/infra/main.bicep b/infra/main.bicep index 696237e..51977ce 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -1,10 +1,8 @@ @minLength(3) - -@maxLength(10) -@description('Prefix for all resources created by this template. This prefix will be used to create unique names for all resources. The prefix must be unique within the resource group.') -param ResourcePrefix string +@description('Prefix for all resources created by this template. This should be 3-20 characters long. If your provide a prefix longer than 20 characters, it will be truncated to 20 characters.') +param Prefix string var abbrs = loadJsonContent('./abbreviations.json') - +var safePrefix = length(Prefix) > 20 ? substring(Prefix, 0, 20) : Prefix @allowed([ 'australiaeast' @@ -49,11 +47,9 @@ var deploymentType = 'GlobalStandard' var containerName = 'appstorage' var llmModel = 'gpt-4o' var storageSkuName = 'Standard_LRS' - -var storageContainerName = '${abbrs.storage.storageAccount}${prefixCleaned}' +var storageContainerName = replace(replace(replace(replace('${ResourcePrefix}cast', '-', ''), '_', ''), '.', ''),'/', '') var gptModelVersion = '2024-08-06' -var aiServicesName = '${abbrs.ai.aiServices}${prefixCleaned}' - +var azureAiServicesName = '${abbrs.ai.aiServices}${ResourcePrefix}' @@ -78,12 +74,7 @@ resource azureAiServices 'Microsoft.CognitiveServices/accounts@2024-04-01-previe } kind: 'AIServices' properties: { - - customSubDomainName: aiServicesName - apiProperties: { - // statisticsEnabled: false - } - + customSubDomainName: azureAiServicesName } } @@ -111,10 +102,8 @@ resource azureAiServicesDeployments 'Microsoft.CognitiveServices/accounts/deploy module managedIdentityModule 'deploy_managed_identity.bicep' = { name: 'deploy_managed_identity' params: { - - miName:'${abbrs.security.managedIdentity}${prefixCleaned}' - solutionName: prefixCleaned - + miName:'${abbrs.security.managedIdentity}${ResourcePrefix}' + solutionName: ResourcePrefix solutionLocation: location } scope: resourceGroup(resourceGroup().name) @@ -125,10 +114,8 @@ module managedIdentityModule 'deploy_managed_identity.bicep' = { module kvault 'deploy_keyvault.bicep' = { name: 'deploy_keyvault' params: { - - keyvaultName: '${abbrs.security.keyVault}${prefixCleaned}' - solutionName: prefixCleaned - + keyvaultName: '${abbrs.security.keyVault}${ResourcePrefix}' + solutionName: ResourcePrefix solutionLocation: location managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId } @@ -165,12 +152,10 @@ module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.9.1 } module databaseAccount 'br/public:avm/res/document-db/database-account:0.9.0' = { - name: toLower('${ResourcePrefix}cosmos') + name: toLower('${abbrs.databases.cosmosDBDatabase}${ResourcePrefix}databaseAccount') params: { // Required parameters - - name: toLower('${abbrs.databases.cosmosDBDatabase}${prefixCleaned}databaseAccount') - + name: toLower('${abbrs.databases.cosmosDBDatabase}${ResourcePrefix}databaseAccount') // Non-required parameters enableAnalyticalStorage: true location: dblocation @@ -234,9 +219,7 @@ module databaseAccount 'br/public:avm/res/document-db/database-account:0.9.0' = } module containerAppFrontend 'br/public:avm/res/app/container-app:0.13.0' = { - - name: toLower('${abbrs.containers.containerApp}${prefixCleaned}containerAppFrontend') - + name: toLower('${abbrs.containers.containerApp}${ResourcePrefix}containerAppFrontend') params: { managedIdentities: { systemAssigned: true @@ -266,9 +249,7 @@ module containerAppFrontend 'br/public:avm/res/app/container-app:0.13.0' = { scaleMinReplicas: 1 scaleMaxReplicas: 1 environmentResourceId: containerAppsEnvironment.outputs.resourceId - - name: toLower('${abbrs.containers.containerApp}${prefixCleaned}containerFrontend') - + name: toLower('${abbrs.containers.containerApp}${ResourcePrefix}Frontend') // Non-required parameters location: location } @@ -276,9 +257,7 @@ module containerAppFrontend 'br/public:avm/res/app/container-app:0.13.0' = { resource containerAppBackend 'Microsoft.App/containerApps@2023-05-01' = { - - name: toLower('${abbrs.containers.containerApp}${prefixCleaned}containerBackend') - + name: toLower('${abbrs.containers.containerApp}${ResourcePrefix}Backend') location: location identity: { type: 'SystemAssigned' @@ -475,7 +454,7 @@ resource containers 'Microsoft.Storage/storageAccounts/blobServices/containers@2 }] resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' existing = { - name: '${ResourcePrefix}-prj' // aiProjectName must be calculated - available at main start. + name: '${abbrs.ai.aiHubProject}${ResourcePrefix}' // aiProjectName must be calculated - available at main start. } resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { From 1de3f92e9387a8ec36216021aff0d5359479afd7 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 21 May 2025 14:44:10 +0530 Subject: [PATCH 4/4] added main.json --- infra/main.json | 125 ++++++++++++++++-------------------------------- 1 file changed, 42 insertions(+), 83 deletions(-) diff --git a/infra/main.json b/infra/main.json index 79accc5..c2344f8 100644 --- a/infra/main.json +++ b/infra/main.json @@ -4,10 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.33.93.31351", - "templateHash": "9645396053164913156" - + "templateHash": "16851365929061577011" } }, "parameters": { @@ -55,7 +53,6 @@ } }, "variables": { - "$fxv#0": { "ai": { "aiSearch": "srch-", @@ -284,10 +281,11 @@ } }, "abbrs": "[variables('$fxv#0')]", - "randomString": "[substring(uniqueString(resourceGroup().id), 0, 4)]", - "finalName": "[format('{0}-{1}', parameters('ResourcePrefix'), variables('randomString'))]", - "imageVersion": "rc1", - + "safePrefix": "[if(greater(length(parameters('Prefix')), 20), substring(parameters('Prefix'), 0, 20), parameters('Prefix'))]", + "uniqueId": "[toLower(uniqueString(subscription().id, variables('safePrefix'), resourceGroup().location))]", + "UniquePrefix": "[format('cm{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]", + "ResourcePrefix": "[take(format('cm{0}{1}', variables('safePrefix'), variables('UniquePrefix')), 15)]", + "imageVersion": "latest", "location": "[resourceGroup().location]", "dblocation": "[resourceGroup().location]", "cosmosdbDatabase": "cmsadb", @@ -298,11 +296,9 @@ "containerName": "appstorage", "llmModel": "gpt-4o", "storageSkuName": "Standard_LRS", - - "storageContainerName": "[format('{0}{1}', variables('abbrs').storage.storageAccount, variables('prefixCleaned'))]", + "storageContainerName": "[replace(replace(replace(replace(format('{0}cast', variables('ResourcePrefix')), '-', ''), '_', ''), '.', ''), '/', '')]", "gptModelVersion": "2024-08-06", - "aiServicesName": "[format('{0}{1}', variables('abbrs').ai.aiServices, variables('prefixCleaned'))]", - + "azureAiServicesName": "[format('{0}{1}', variables('abbrs').ai.aiServices, variables('ResourcePrefix'))]", "aiModelDeployments": [ { "name": "[variables('llmModel')]", @@ -331,10 +327,7 @@ }, "kind": "AIServices", "properties": { - - "customSubDomainName": "[variables('aiServicesName')]", - "apiProperties": {} - + "customSubDomainName": "[variables('azureAiServicesName')]" } }, { @@ -366,9 +359,7 @@ { "type": "Microsoft.App/containerApps", "apiVersion": "2023-05-01", - - "name": "[toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))]", - + "name": "[toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))]", "location": "[variables('location')]", "identity": { "type": "SystemAssigned" @@ -393,7 +384,7 @@ "env": [ { "name": "COSMOSDB_ENDPOINT", - "value": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}cosmos', variables('ResourcePrefix')))), '2022-09-01').outputs.endpoint.value]" + "value": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))), '2022-09-01').outputs.endpoint.value]" }, { "name": "COSMOSDB_DATABASE", @@ -483,7 +474,7 @@ "dependsOn": [ "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry')]", "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('ResourcePrefix'))))]", - "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}cosmos', variables('ResourcePrefix'))))]", + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix'))))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('storageContainerName'))]" ] }, @@ -544,32 +535,28 @@ "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2022-04-01", "scope": "[format('Microsoft.Storage/storageAccounts/{0}', variables('storageContainerName'))]", - - "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), 'Storage Blob Data Contributor')]", + "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), 'Storage Blob Data Contributor')]", "properties": { "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", - "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId]" + "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), '2023-05-01', 'full').identity.principalId]" }, "dependsOn": [ - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]", - + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix'))))]", "[resourceId('Microsoft.Storage/storageAccounts', variables('storageContainerName'))]" ] }, { "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2022-04-01", - - "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', variables('aiServicesName'))]", - "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), variables('openAiContributorRoleId'))]", + "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', variables('azureAiServicesName'))]", + "name": "[guid(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), variables('openAiContributorRoleId'))]", "properties": { "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', variables('openAiContributorRoleId'))]", - "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId]" + "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), '2023-05-01', 'full').identity.principalId]" }, "dependsOn": [ - "[resourceId('Microsoft.CognitiveServices/accounts', variables('aiServicesName'))]", - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]" - + "[resourceId('Microsoft.CognitiveServices/accounts', variables('azureAiServicesName'))]", + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix'))))]" ] }, { @@ -590,14 +577,14 @@ { "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2022-04-01", - "scope": "[format('Microsoft.MachineLearningServices/workspaces/{0}', format('{0}-prj', variables('ResourcePrefix')))]", - "name": "[guid(toLower(format('{0}Bck-ca', variables('ResourcePrefix'))), resourceId('Microsoft.MachineLearningServices/workspaces', format('{0}-prj', variables('ResourcePrefix'))), resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee'))]", + "scope": "[format('Microsoft.MachineLearningServices/workspaces/{0}', format('{0}{1}', variables('abbrs').ai.aiHubProject, variables('ResourcePrefix')))]", + "name": "[guid(toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix'))), resourceId('Microsoft.MachineLearningServices/workspaces', format('{0}{1}', variables('abbrs').ai.aiHubProject, variables('ResourcePrefix'))), resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee'))]", "properties": { "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee')]", - "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}Bck-ca', variables('ResourcePrefix')))), '2023-05-01', 'full').identity.principalId]" + "principalId": "[reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), '2023-05-01', 'full').identity.principalId]" }, "dependsOn": [ - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}Bck-ca', variables('ResourcePrefix'))))]" + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix'))))]" ] }, { @@ -612,7 +599,7 @@ "mode": "Incremental", "parameters": { "miName": { - "value": "[format('{0}{1}', variables('abbrs').security.managedIdentity, variables('prefixCleaned'))]" + "value": "[format('{0}{1}', variables('abbrs').security.managedIdentity, variables('ResourcePrefix'))]" }, "solutionName": { "value": "[variables('ResourcePrefix')]" @@ -627,10 +614,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.33.93.31351", "templateHash": "4801202077166882355" - } }, "parameters": { @@ -650,8 +635,6 @@ }, "miName": { "type": "string", - - "metadata": { "description": "Name" } @@ -713,7 +696,7 @@ "mode": "Incremental", "parameters": { "keyvaultName": { - "value": "[format('{0}{1}', variables('abbrs').security.keyVault, variables('prefixCleaned'))]" + "value": "[format('{0}{1}', variables('abbrs').security.keyVault, variables('ResourcePrefix'))]" }, "solutionName": { "value": "[variables('ResourcePrefix')]" @@ -731,10 +714,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.33.93.31351", - "templateHash": "15626032116057754317" - + "templateHash": "3632224099881800620" } }, "parameters": { @@ -869,10 +850,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.33.93.31351", - "templateHash": "17234510752657929213" - + "templateHash": "9456018511253136487" } }, "parameters": { @@ -907,14 +886,9 @@ }, "aiServicesId": { "type": "string" - }, - "storageName": { - "type": "string", - "defaultValue": "[format('{0}hubst', parameters('solutionName'))]" } }, "variables": { - "$fxv#0": { "ai": { "aiSearch": "srch-", @@ -1143,20 +1117,19 @@ } }, "abbrs": "[variables('$fxv#0')]", - "storageName": "[format('{0}{1}hubst', variables('abbrs').storage.storageAccount, parameters('solutionName'))]", + "storageName": "[format('{0}{1}', variables('abbrs').storage.storageAccount, parameters('solutionName'))]", "storageSkuName": "Standard_LRS", "aiServicesName": "[format('{0}{1}', variables('abbrs').ai.aiServices, parameters('solutionName'))]", "workspaceName": "[format('{0}{1}', variables('abbrs').managementGovernance.logAnalyticsWorkspace, parameters('solutionName'))]", "keyvaultName": "[format('{0}{1}', variables('abbrs').security.keyVault, parameters('solutionName'))]", "location": "[parameters('solutionLocation')]", - "aiHubName": "[format('{0}{1}', variables('abbrs').ai.aiHub, parameters('solutionName'))]", - "aiHubFriendlyName": "[variables('aiHubName')]", + "azureAiHubName": "[format('{0}{1}', variables('abbrs').ai.aiHub, parameters('solutionName'))]", + "aiHubFriendlyName": "[variables('azureAiHubName')]", "aiHubDescription": "AI Hub for KM template", "aiProjectName": "[format('{0}{1}', variables('abbrs').ai.aiHubProject, parameters('solutionName'))]", "aiProjectFriendlyName": "[variables('aiProjectName')]", "aiSearchName": "[format('{0}{1}', variables('abbrs').ai.aiSearch, parameters('solutionName'))]", - "storageNameCleaned": "[replace(variables('storageName'), '-', '')]" - + "storageNameCleaned": "[replace(replace(replace(replace(format('{0}cast', variables('storageName')), '-', ''), '_', ''), '.', ''), '/', '')]" }, "resources": [ { @@ -2096,7 +2069,7 @@ { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", - "name": "[toLower(format('{0}cosmos', variables('ResourcePrefix')))]", + "name": "[toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -2104,9 +2077,7 @@ "mode": "Incremental", "parameters": { "name": { - - "value": "[toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('prefixCleaned')))]" - + "value": "[toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))]" }, "enableAnalyticalStorage": { "value": true @@ -5914,9 +5885,7 @@ { "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", - - "name": "[toLower(format('{0}{1}containerAppFrontend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))]", - + "name": "[toLower(format('{0}{1}containerAppFrontend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -5937,9 +5906,7 @@ "env": [ { "name": "API_URL", - - "value": "[format('https://{0}', reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01').configuration.ingress.fqdn)]" - + "value": "[format('https://{0}', reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), '2023-05-01').configuration.ingress.fqdn)]" } ], "image": "[format('cmsacontainerreg.azurecr.io/cmsafrontend:{0}', variables('imageVersion'))]", @@ -5967,9 +5934,7 @@ "value": "[reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('ResourcePrefix')))), '2022-09-01').outputs.resourceId.value]" }, "name": { - - "value": "[toLower(format('{0}{1}containerFrontend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))]" - + "value": "[toLower(format('{0}{1}Frontend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))]" }, "location": { "value": "[variables('location')]" @@ -7141,10 +7106,8 @@ } }, "dependsOn": [ - - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]", - "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('prefixCleaned'))))]", - + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix'))))]", + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}conAppsEnv', variables('ResourcePrefix'))))]", "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" ] }, @@ -7178,9 +7141,7 @@ } }, "scriptContent": { - - "value": "[format('az cosmosdb sql role assignment create --resource-group \"{0}\" --account-name \"{1}\" --role-definition-id \"{2}\" --scope \"{3}\" --principal-id \"{4}\"', resourceGroup().name, reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.name.value, resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[0], split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}database', variables('prefixCleaned')))), '/')[1]), reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned')))), '2022-09-01').outputs.resourceId.value, reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned')))), '2023-05-01', 'full').identity.principalId)]" - + "value": "[format('az cosmosdb sql role assignment create --resource-group \"{0}\" --account-name \"{1}\" --role-definition-id \"{2}\" --scope \"{3}\" --principal-id \"{4}\"', resourceGroup().name, reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))), '2022-09-01').outputs.name.value, resourceId('Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions', split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))), '/')[0], split(format('{0}/00000000-0000-0000-0000-000000000002', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))), '/')[1]), reference(resourceId('Microsoft.Resources/deployments', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix')))), '2022-09-01').outputs.resourceId.value, reference(resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix')))), '2023-05-01', 'full').identity.principalId)]" } }, "template": { @@ -7709,10 +7670,8 @@ } }, "dependsOn": [ - - "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}containerBackend', variables('abbrs').containers.containerApp, variables('prefixCleaned'))))]", - "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}database', variables('prefixCleaned'))))]", - + "[resourceId('Microsoft.App/containerApps', toLower(format('{0}{1}Backend', variables('abbrs').containers.containerApp, variables('ResourcePrefix'))))]", + "[resourceId('Microsoft.Resources/deployments', toLower(format('{0}{1}databaseAccount', variables('abbrs').databases.cosmosDBDatabase, variables('ResourcePrefix'))))]", "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity')]" ] }