diff --git a/deploy/aca/azure.yaml b/deploy/aca/azure.yaml deleted file mode 100644 index f533b6b..0000000 --- a/deploy/aca/azure.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json - -name: personal-finance-assistance-java -metadata: - template: personal-finance-assistance-java@1.0.0-alpha -services: - copilot: - project: ../../app/copilot - language: java - host: containerapp - account: - project: ../../app/business-api/account - language: java - host: containerapp - payment: - project: ../../app/business-api/payment - language: java - host: containerapp - transaction: - project: ../../app/business-api/transactions-history - language: java - host: containerapp - web: - project: ../../app/frontend - language: js - host: containerapp diff --git a/deploy/aca/compose.yaml b/deploy/aca/compose.yaml deleted file mode 100644 index b852207..0000000 --- a/deploy/aca/compose.yaml +++ /dev/null @@ -1,40 +0,0 @@ -services: - frontend: - image: personal-finance-assistant-java/frontend - build: ../../app/frontend - environment: - REACT_APP_API_BASE_URL: "http://copilot:8080" - ports: - - "80:80" - copilot: - image: personal-finance-assistant-java/copilot-backend - build: ../../app/copilot - environment: - - AZURE_STORAGE_ACCOUNT=${AZURE_STORAGE_ACCOUNT} - - AZURE_STORAGE_CONTAINER=${AZURE_STORAGE_CONTAINER} - - AZURE_OPENAI_CHATGPT_MODEL=${AZURE_OPENAI_CHATGPT_MODEL} - - AZURE_OPENAI_SERVICE=${AZURE_OPENAI_SERVICE} - - AZURE_OPENAI_CHATGPT_DEPLOYMENT=${AZURE_OPENAI_CHATGPT_DEPLOYMENT} - - spring_profiles_active=docker - - ACCOUNTS_API_SERVER_URL=http://account:8080 - - PAYMENTS_API_SERVER_URL=http://payment:8080 - - TRANSACTIONS_API_SERVER_URL=http://transaction:8080 - - AZURE_CLIENT_ID=${servicePrincipal} - - AZURE_CLIENT_SECRET=${servicePrincipalPassword} - - AZURE_TENANT_ID=${servicePrincipalTenant} - account: - image: personal-finance-assistant-java/business-account - build: - context: ../../app/business-api/account - payment: - image: personal-finance-assistant-java/business-payment - build: - context: ../../app/business-api/payment - environment: - - TRANSACTIONS_API_SERVER_URL=http://transaction:8080 - transaction: - image: personal-finance-assistant-java/business-transaction-history - build: - context: ../../app/business-api/transactions-history - - diff --git a/deploy/aca/infra/app/account.bicep b/deploy/aca/infra/app/account.bicep deleted file mode 100644 index 9ab7190..0000000 --- a/deploy/aca/infra/app/account.bicep +++ /dev/null @@ -1,64 +0,0 @@ -param name string -param location string = resourceGroup().location -param tags object = {} - -param identityName string -param applicationInsightsName string -param containerAppsEnvironmentName string -param containerRegistryName string -param serviceName string = 'account' -param corsAcaUrl string -param exists bool - -@description('The environment variables for the container') -param env array = [] - -resource apiIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: identityName - location: location -} - - -module app '../../../shared/host/container-app-upsert.bicep' = { - name: '${serviceName}-container-app' - params: { - name: name - location: location - tags: union(tags, { 'azd-service-name': serviceName }) - identityType: 'UserAssigned' - identityName: apiIdentity.name - exists: exists - containerAppsEnvironmentName: containerAppsEnvironmentName - containerRegistryName: containerRegistryName - containerCpuCoreCount: '1.0' - containerMemory: '2.0Gi' - targetPort: 8080 - external:false - env: union(env, [ - { - name: 'AZURE_CLIENT_ID' - value: apiIdentity.properties.clientId - } - - { - name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' - value: applicationInsights.properties.ConnectionString - } - { - name: 'API_ALLOW_ORIGINS' - value: corsAcaUrl - } - ]) - - } -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { - name: applicationInsightsName -} - - -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = apiIdentity.properties.principalId -output SERVICE_API_NAME string = app.outputs.name -output SERVICE_API_URI string = app.outputs.uri -output SERVICE_API_IMAGE_NAME string = app.outputs.imageName diff --git a/deploy/aca/infra/app/copilot.bicep b/deploy/aca/infra/app/copilot.bicep deleted file mode 100644 index 24193e1..0000000 --- a/deploy/aca/infra/app/copilot.bicep +++ /dev/null @@ -1,64 +0,0 @@ -param name string -param location string = resourceGroup().location -param tags object = {} - -param identityName string -param applicationInsightsName string -param containerAppsEnvironmentName string -param containerRegistryName string -param serviceName string = 'copilot' -param corsAcaUrl string -param exists bool - -@description('The environment variables for the container') -param env array = [] - -resource apiIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: identityName - location: location -} - - -module app '../../../shared/host/container-app-upsert.bicep' = { - name: '${serviceName}-container-app' - params: { - name: name - location: location - tags: union(tags, { 'azd-service-name': serviceName }) - identityType: 'UserAssigned' - identityName: apiIdentity.name - exists: exists - containerAppsEnvironmentName: containerAppsEnvironmentName - containerRegistryName: containerRegistryName - containerCpuCoreCount: '1.0' - containerMemory: '2.0Gi' - targetPort: 8080 - external:false - env: union(env, [ - { - name: 'AZURE_CLIENT_ID' - value: apiIdentity.properties.clientId - } - - { - name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' - value: applicationInsights.properties.ConnectionString - } - { - name: 'API_ALLOW_ORIGINS' - value: corsAcaUrl - } - ]) - - } -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { - name: applicationInsightsName -} - - -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = apiIdentity.properties.principalId -output SERVICE_API_NAME string = app.outputs.name -output SERVICE_API_URI string = app.outputs.uri -output SERVICE_API_IMAGE_NAME string = app.outputs.imageName diff --git a/deploy/aca/infra/app/payment.bicep b/deploy/aca/infra/app/payment.bicep deleted file mode 100644 index 3d4bc47..0000000 --- a/deploy/aca/infra/app/payment.bicep +++ /dev/null @@ -1,64 +0,0 @@ -param name string -param location string = resourceGroup().location -param tags object = {} - -param identityName string -param applicationInsightsName string -param containerAppsEnvironmentName string -param containerRegistryName string -param serviceName string = 'payment' -param corsAcaUrl string -param exists bool - -@description('The environment variables for the container') -param env array = [] - -resource apiIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: identityName - location: location -} - - -module app '../../../shared/host/container-app-upsert.bicep' = { - name: '${serviceName}-container-app' - params: { - name: name - location: location - tags: union(tags, { 'azd-service-name': serviceName }) - identityType: 'UserAssigned' - identityName: apiIdentity.name - exists: exists - containerAppsEnvironmentName: containerAppsEnvironmentName - containerRegistryName: containerRegistryName - containerCpuCoreCount: '1.0' - containerMemory: '2.0Gi' - targetPort: 8080 - external:false - env: union(env, [ - { - name: 'AZURE_CLIENT_ID' - value: apiIdentity.properties.clientId - } - - { - name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' - value: applicationInsights.properties.ConnectionString - } - { - name: 'API_ALLOW_ORIGINS' - value: corsAcaUrl - } - ]) - - } -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { - name: applicationInsightsName -} - - -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = apiIdentity.properties.principalId -output SERVICE_API_NAME string = app.outputs.name -output SERVICE_API_URI string = app.outputs.uri -output SERVICE_API_IMAGE_NAME string = app.outputs.imageName diff --git a/deploy/aca/infra/app/transaction.bicep b/deploy/aca/infra/app/transaction.bicep deleted file mode 100644 index b7d3726..0000000 --- a/deploy/aca/infra/app/transaction.bicep +++ /dev/null @@ -1,64 +0,0 @@ -param name string -param location string = resourceGroup().location -param tags object = {} - -param identityName string -param applicationInsightsName string -param containerAppsEnvironmentName string -param containerRegistryName string -param serviceName string = 'transaction' -param corsAcaUrl string -param exists bool - -@description('The environment variables for the container') -param env array = [] - -resource apiIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: identityName - location: location -} - - -module app '../../../shared/host/container-app-upsert.bicep' = { - name: '${serviceName}-container-app' - params: { - name: name - location: location - tags: union(tags, { 'azd-service-name': serviceName }) - identityType: 'UserAssigned' - identityName: apiIdentity.name - exists: exists - containerAppsEnvironmentName: containerAppsEnvironmentName - containerRegistryName: containerRegistryName - containerCpuCoreCount: '1.0' - containerMemory: '2.0Gi' - targetPort: 8080 - external:false - env: union(env, [ - { - name: 'AZURE_CLIENT_ID' - value: apiIdentity.properties.clientId - } - - { - name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' - value: applicationInsights.properties.ConnectionString - } - { - name: 'API_ALLOW_ORIGINS' - value: corsAcaUrl - } - ]) - - } -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { - name: applicationInsightsName -} - - -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = apiIdentity.properties.principalId -output SERVICE_API_NAME string = app.outputs.name -output SERVICE_API_URI string = app.outputs.uri -output SERVICE_API_IMAGE_NAME string = app.outputs.imageName diff --git a/deploy/aca/infra/app/web.bicep b/deploy/aca/infra/app/web.bicep deleted file mode 100644 index 97eea10..0000000 --- a/deploy/aca/infra/app/web.bicep +++ /dev/null @@ -1,54 +0,0 @@ -param name string -param location string = resourceGroup().location -param tags object = {} - -param identityName string -param apiBaseUrl string -param applicationInsightsName string -param containerAppsEnvironmentName string -param containerRegistryName string -param serviceName string = 'web' -param exists bool - -resource webIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: identityName - location: location -} - -module app '../../../shared/host/container-app-upsert.bicep' = { - name: '${serviceName}-container-app' - params: { - name: name - location: location - tags: union(tags, { 'azd-service-name': serviceName }) - identityType: 'UserAssigned' - identityName: identityName - exists: exists - containerAppsEnvironmentName: containerAppsEnvironmentName - containerRegistryName: containerRegistryName - env: [ - { - name: 'REACT_APP_APPLICATIONINSIGHTS_CONNECTION_STRING' - value: applicationInsights.properties.ConnectionString - } - { - name: 'REACT_APP_API_BASE_URL' - value: apiBaseUrl - } - { - name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' - value: applicationInsights.properties.ConnectionString - } - ] - targetPort: 80 - } -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { - name: applicationInsightsName -} - -output SERVICE_WEB_IDENTITY_PRINCIPAL_ID string = webIdentity.properties.principalId -output SERVICE_WEB_NAME string = app.outputs.name -output SERVICE_WEB_URI string = app.outputs.uri -output SERVICE_WEB_IMAGE_NAME string = app.outputs.imageName diff --git a/deploy/aca/infra/main.bicep b/deploy/aca/infra/main.bicep deleted file mode 100644 index 8dd6677..0000000 --- a/deploy/aca/infra/main.bicep +++ /dev/null @@ -1,402 +0,0 @@ -targetScope = 'subscription' - -@minLength(1) -@maxLength(64) -@description('Name of the the environment which is used to generate a short unique hash used in all resources.') -param environmentName string - -@minLength(1) -@description('Primary location for all resources') -param location string - - - -param resourceGroupName string = '' - -param applicationInsightsName string = '' -param logAnalyticsName string = '' - - - -param storageAccountName string = '' -param storageResourceGroupName string = '' - -param storageResourceGroupLocation string = location -param storageContainerName string = 'content' -param storageSkuName string // Set in main.parameters.json - - - -param openAiServiceName string = '' -param openAiResourceGroupName string = '' -@description('Location for the OpenAI resource group') -@allowed(['eastus', 'eastus2', 'northcentralus', 'southcentralus', 'swedencentral', 'westus', 'westus3']) -@metadata({ - azd: { - type: 'location' - } -}) -param openAiResourceGroupLocation string -param customOpenAiResourceGroupLocation string = '' - -param openAiSkuName string = 'S0' - -param openAiApiKey string = '' -param openAiApiOrganization string = '' - -param documentIntelligenceServiceName string = '' -param documentIntelligenceResourceGroupName string = '' -//Document Intelligence new rest api available in eastus, westus2, westeurope. https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/sdk-overview-v4-0?view=doc-intel-4.0.0&tabs=csharp -@allowed(['eastus', 'westus2', 'westeurope']) -param documentIntelligenceResourceGroupLocation string = 'eastus' - -param documentIntelligenceSkuName string = 'S0' - -param chatGptDeploymentName string // Set in main.parameters.json -param chatGptDeploymentCapacity int = 60 -param chatGptModelName string = 'gpt-4o' -param chatGptModelVersion string = '2024-05-13' - - - - -param containerAppsEnvironmentName string = '' -param containerRegistryName string = '' - -param copilotContainerAppName string = '' -param webContainerAppName string = '' -param accountContainerAppName string = '' -param transactionContainerAppName string = '' -param paymentContainerAppName string = '' -param copilotAppExists bool = false -param webAppExists bool = false -param accountAppExists bool = false -param paymentAppExists bool = false -param transactionAppExists bool = false - - - -@description('Use Application Insights for monitoring and performance tracing') -param useApplicationInsights bool = false - -var abbrs = loadJsonContent('../../shared/abbreviations.json') -var resourceToken = toLower(uniqueString(subscription().id, environmentName, location)) -var tags = { 'azd-env-name': environmentName, 'assignedTo': environmentName } - -// Organize resources in a resource group -resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { - name: !empty(resourceGroupName) ? resourceGroupName : '${abbrs.resourcesResourceGroups}${environmentName}' - location: location - tags: tags -} - -resource openAiResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = if (!empty(openAiResourceGroupName)) { - name: !empty(openAiResourceGroupName) ? openAiResourceGroupName : resourceGroup.name -} - -resource documentIntelligenceResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = if (!empty(documentIntelligenceResourceGroupName)) { - name: !empty(documentIntelligenceResourceGroupName) ? documentIntelligenceResourceGroupName : resourceGroup.name -} - - - -resource storageResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = if (!empty(storageResourceGroupName)) { - name: !empty(storageResourceGroupName) ? storageResourceGroupName : resourceGroup.name -} - -// Monitor application with Azure Monitor -module monitoring '../../shared/monitor/monitoring.bicep' = if (useApplicationInsights) { - name: 'monitoring' - scope: resourceGroup - params: { - location: location - tags: tags - applicationInsightsName: !empty(applicationInsightsName) ? applicationInsightsName : '${abbrs.insightsComponents}${resourceToken}' - logAnalyticsName: !empty(logAnalyticsName) ? logAnalyticsName : '${abbrs.operationalInsightsWorkspaces}${resourceToken}' - } -} - - -module containerApps '../../shared/host/container-apps.bicep' = { - name: 'container-apps' - scope: resourceGroup - params: { - name: 'app' - location: location - tags: tags - containerAppsEnvironmentName: !empty(containerAppsEnvironmentName) ? containerAppsEnvironmentName : '${abbrs.appManagedEnvironments}${resourceToken}' - containerRegistryName: !empty(containerRegistryName) ? containerRegistryName : '${abbrs.containerRegistryRegistries}${resourceToken}' - logAnalyticsWorkspaceName: monitoring.outputs.logAnalyticsWorkspaceName - applicationInsightsName: monitoring.outputs.applicationInsightsName - } -} - -// Copilot backend -module copilot './app/copilot.bicep' = { - name: 'copilot' - scope: resourceGroup - params: { - name: !empty(copilotContainerAppName) ? copilotContainerAppName : '${abbrs.appContainerApps}copilot-${resourceToken}' - location: location - tags: tags - identityName: '${abbrs.managedIdentityUserAssignedIdentities}copilot-${resourceToken}' - applicationInsightsName: monitoring.outputs.applicationInsightsName - containerAppsEnvironmentName: containerApps.outputs.environmentName - containerRegistryName: containerApps.outputs.registryName - corsAcaUrl: '' - exists: copilotAppExists - env: [ - { - name: 'AZURE_STORAGE_ACCOUNT' - value: storage.outputs.name - } - { - name: 'AZURE_STORAGE_CONTAINER' - value: storageContainerName - } - - { - name: 'AZURE_OPENAI_SERVICE' - value: openAi.outputs.name - } - { - name: 'AZURE_OPENAI_CHATGPT_DEPLOYMENT' - value: chatGptDeploymentName - } - { - name: 'AZURE_DOCUMENT_INTELLIGENCE_SERVICE' - value: documentIntelligence.outputs.name - } - { - name: 'TRANSACTIONS_API_SERVER_URL' - value: transaction.outputs.SERVICE_API_URI - } - { - name: 'PAYMENTS_API_SERVER_URL' - value: payment.outputs.SERVICE_API_URI - } - { - name: 'ACCOUNTS_API_SERVER_URL' - value: account.outputs.SERVICE_API_URI} - - ] - } -} - -// Business Account Api -module account './app/account.bicep' = { - name: 'account' - scope: resourceGroup - params: { - name: !empty(accountContainerAppName) ? accountContainerAppName : '${abbrs.appContainerApps}account-${resourceToken}' - location: location - tags: tags - identityName: '${abbrs.managedIdentityUserAssignedIdentities}account-${resourceToken}' - applicationInsightsName: monitoring.outputs.applicationInsightsName - containerAppsEnvironmentName: containerApps.outputs.environmentName - containerRegistryName: containerApps.outputs.registryName - corsAcaUrl: '' - exists: accountAppExists - - } -} - -// Business Transactions Api -module transaction './app/transaction.bicep' = { - name: 'transaction' - scope: resourceGroup - params: { - name: !empty(transactionContainerAppName) ? transactionContainerAppName : '${abbrs.appContainerApps}transaction-${resourceToken}' - location: location - tags: tags - identityName: '${abbrs.managedIdentityUserAssignedIdentities}transaction-${resourceToken}' - applicationInsightsName: monitoring.outputs.applicationInsightsName - containerAppsEnvironmentName: containerApps.outputs.environmentName - containerRegistryName: containerApps.outputs.registryName - corsAcaUrl: '' - exists: transactionAppExists - - } -} - -// Business Transactions Api -module payment './app/payment.bicep' = { - name: 'payment' - scope: resourceGroup - params: { - name: !empty(paymentContainerAppName) ? paymentContainerAppName : '${abbrs.appContainerApps}payment-${resourceToken}' - location: location - tags: tags - identityName: '${abbrs.managedIdentityUserAssignedIdentities}payment-${resourceToken}' - applicationInsightsName: monitoring.outputs.applicationInsightsName - containerAppsEnvironmentName: containerApps.outputs.environmentName - containerRegistryName: containerApps.outputs.registryName - corsAcaUrl: '' - exists: paymentAppExists - env: [ - { - name: 'TRANSACTIONS_API_SERVER_URL' - value: transaction.outputs.SERVICE_API_URI - } - - ] - - } -} - -module web './app/web.bicep' = { - name: 'web' - scope: resourceGroup - params: { - name: !empty(webContainerAppName) ? webContainerAppName : '${abbrs.appContainerApps}web-${resourceToken}' - location: location - tags: tags - identityName: '${abbrs.managedIdentityUserAssignedIdentities}web-${resourceToken}' - apiBaseUrl: copilot.outputs.SERVICE_API_URI - applicationInsightsName: monitoring.outputs.applicationInsightsName - containerAppsEnvironmentName: containerApps.outputs.environmentName - containerRegistryName: containerApps.outputs.registryName - exists: webAppExists - } -} - - -module openAi '../../shared/ai/cognitiveservices.bicep' = { - name: 'openai' - scope: openAiResourceGroup - params: { - name: !empty(openAiServiceName) ? openAiServiceName : '${abbrs.cognitiveServicesAccounts}${resourceToken}' - location: !empty(customOpenAiResourceGroupLocation) ? customOpenAiResourceGroupLocation : openAiResourceGroupLocation - tags: tags - sku: { - name: openAiSkuName - } - deployments: [ - { - name: chatGptDeploymentName - model: { - format: 'OpenAI' - name: chatGptModelName - version: chatGptModelVersion - } - sku: { - name: 'Standard' - capacity: chatGptDeploymentCapacity - } - } - - ] - } -} - -module documentIntelligence '../../shared/ai/cognitiveservices.bicep' = { - name: 'documentIntelligence' - scope: documentIntelligenceResourceGroup - params: { - name: !empty(documentIntelligenceServiceName) ? documentIntelligenceServiceName : '${abbrs.cognitiveServicesFormRecognizer}${resourceToken}' - kind: 'FormRecognizer' - location: documentIntelligenceResourceGroupLocation - tags: tags - sku: { - name: documentIntelligenceSkuName - } - } -} - - - -module storage '../../shared/storage/storage-account.bicep' = { - name: 'storage' - scope: storageResourceGroup - params: { - name: !empty(storageAccountName) ? storageAccountName : '${abbrs.storageStorageAccounts}${resourceToken}' - location: storageResourceGroupLocation - tags: tags - allowBlobPublicAccess: false - publicNetworkAccess: 'Enabled' - sku: { - name: storageSkuName - } - deleteRetentionPolicy: { - enabled: true - days: 2 - } - containers: [ - { - name: storageContainerName - publicAccess: 'None' - } - ] - } -} - - - - -// SYSTEM IDENTITIES - -module openAiRoleBackend '../../shared/security/role.bicep' = { - scope: openAiResourceGroup - name: 'openai-role-backend' - params: { - principalId: copilot.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID - roleDefinitionId: '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd' - principalType: 'ServicePrincipal' - } -} - -module storageRoleBackend '../../shared/security/role.bicep' = { - scope: storageResourceGroup - name: 'storage-role-backend' - params: { - principalId: copilot.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID - roleDefinitionId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' - principalType: 'ServicePrincipal' - } -} - -module documentIntelligenceRoleCopilot '../../shared/security/role.bicep' = { - scope: documentIntelligenceResourceGroup - name: 'documentIntelligence-role-copilot' - params: { - principalId: copilot.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID - roleDefinitionId: 'a97b65f3-24c7-4388-baec-2e87135dc908' - principalType: 'ServicePrincipal' - } -} - -output AZURE_LOCATION string = location -output AZURE_TENANT_ID string = tenant().tenantId -output AZURE_RESOURCE_GROUP string = resourceGroup.name - - -output AZURE_CONTAINER_ENVIRONMENT_NAME string = containerApps.outputs.environmentName -output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerApps.outputs.registryLoginServer -output AZURE_CONTAINER_REGISTRY_NAME string = containerApps.outputs.registryName - -// Shared by all OpenAI deployments - -output AZURE_OPENAI_CHATGPT_MODEL string = chatGptModelName -// Specific to Azure OpenAI -output AZURE_OPENAI_SERVICE string = openAi.outputs.name -output AZURE_OPENAI_RESOURCE_GROUP string = openAiResourceGroup.name -output AZURE_OPENAI_CHATGPT_DEPLOYMENT string = chatGptDeploymentName - -// Used only with non-Azure OpenAI deployments -output OPENAI_API_KEY string = openAiApiKey -output OPENAI_ORGANIZATION string = openAiApiOrganization - -output AZURE_DOCUMENT_INTELLIGENCE_SERVICE string = documentIntelligence.outputs.name -output AZURE_DOCUMENT_INTELLIGENCE_RESOURCE_GROUP string = documentIntelligenceResourceGroup.name - - - - -output AZURE_STORAGE_ACCOUNT string = storage.outputs.name -output AZURE_STORAGE_CONTAINER string = storageContainerName -output AZURE_STORAGE_RESOURCE_GROUP string = storageResourceGroup.name - - - -// output BACKEND_URI string = backend.outputs.uri -// output INDEXER_FUNCTIONAPP_NAME string = indexer.outputs.name diff --git a/deploy/aca/infra/main.parameters.json b/deploy/aca/infra/main.parameters.json deleted file mode 100644 index f2caef8..0000000 --- a/deploy/aca/infra/main.parameters.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "environmentName": { - "value": "${AZURE_ENV_NAME}" - }, - "resourceGroupName": { - "value": "${AZURE_RESOURCE_GROUP}" - }, - "location": { - "value": "${AZURE_LOCATION}" - }, - "openAiServiceName": { - "value": "${AZURE_OPENAI_SERVICE}" - }, - "openAiResourceGroupName": { - "value": "${AZURE_OPENAI_RESOURCE_GROUP}" - }, - "customOpenAiResourceGroupLocation": { - "value": "${AZURE_OPENAI_SERVICE_LOCATION}" - }, - "openAiSkuName": { - "value": "S0" - }, - "documentIntelligenceServiceName": { - "value": "${AZURE_DOCUMENT_INTELLIGENCE_SERVICE}" - }, - "documentIntelligenceResourceGroupName": { - "value": "${AZURE_DOCUMENT_INTELLIGENCE_RESOURCE_GROUP}" - }, - "documentIntelligenceResourceGroupLocation": { - "value": "${AZURE_DOCUMENT_INTELLIGENCE_RESOURCE_GROUP_LOCATION}" - }, - "documentIntelligenceSkuName": { - "value": "S0" - }, - "storageAccountName": { - "value": "${AZURE_STORAGE_ACCOUNT}" - }, - "storageResourceGroupName": { - "value": "${AZURE_STORAGE_RESOURCE_GROUP}" - }, - "storageSkuName": { - "value": "${AZURE_STORAGE_SKU=Standard_LRS}" - }, - "chatGptModelName": { - "value": "${AZURE_OPENAI_CHATGPT_MODEL=gpt-4o}" - }, - "chatGptModelVersion": { - "value": "${AZURE_OPENAI_CHATGPT_VERSION=2024-05-13}" - }, - "chatGptDeploymentName": { - "value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=gpt-4o}" - }, - "useApplicationInsights": { - "value": "${AZURE_USE_APPLICATION_INSIGHTS=true}" - } - , - "copilotAppExists": { - "value": false - }, - "webAppExists": { - "value": false - }, - "accountAppExists": { - "value": false - }, - "paymentAppExists": { - "value": false - }, - "transactionAppExists": { - "value": false - } - } - -} diff --git a/deploy/aca/start-compose.ps1 b/deploy/aca/start-compose.ps1 deleted file mode 100644 index b1d0a5a..0000000 --- a/deploy/aca/start-compose.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -$output = azd -C ..\deploy\aca env get-values - -foreach ($line in $output) { - $name, $value = $line.Split("=") - $value = $value -replace '^\"|\"$' - [Environment]::SetEnvironmentVariable($name, $value) -} - -Write-Host "Environment variables set." -$roles = @( - "a97b65f3-24c7-4388-baec-2e87135dc908", - "5e0bd9bd-7b93-4f28-af87-19fc36ad61bd", - "ba92f5b4-2d11-453d-a403-e96b0029c9fe" -) - -# Check if service principal exists -$servicePrincipal = $(az ad sp list --display-name "virtual-ai-agent-java-spi" --query [].appId --output tsv) - -if ([string]::IsNullOrEmpty($servicePrincipal)) { - Write-Host "Service principal not found. Creating service principal" - $servicePrincipal = $(az ad sp create-for-rbac --name "virtual-ai-agent-java-spi" --role reader --scopes "/subscriptions/$($env:AZURE_SUBSCRIPTION_ID)/resourceGroups/$($env:AZURE_RESOURCE_GROUP)" --query appId --output tsv) - if ($LASTEXITCODE -ne 0) { - Write-Host "Failed to create service principal" - exit $LASTEXITCODE - } - $servicePrincipalObjectId = $(az ad sp show --id $servicePrincipal --query id --output tsv) - Write-Host "Assigning Roles to service principal virtual-ai-agent-java-spi with principal id: $servicePrincipal and object id[$servicePrincipalObjectId]" - foreach ($role in $roles) { - Write-Host "Assigning Role[$role] to principal id[$servicePrincipal] for resource[/subscriptions/$($env:AZURE_SUBSCRIPTION_ID)/resourceGroups/$($env:AZURE_RESOURCE_GROUP)]" - az role assignment create ` - --role $role ` - --assignee-object-id $servicePrincipalObjectId ` - --scope "/subscriptions/$($env:AZURE_SUBSCRIPTION_ID)/resourceGroups/$($env:AZURE_RESOURCE_GROUP)" ` - --assignee-principal-type ServicePrincipal - } -} - -$servicePrincipalPassword = $(az ad sp credential reset --id $servicePrincipal --query password --output tsv) -$servicePrincipalTenant = $(az ad sp show --id $servicePrincipal --query appOwnerOrganizationId --output tsv) - -# Set environment variables -[Environment]::SetEnvironmentVariable("servicePrincipal", $servicePrincipal) -[Environment]::SetEnvironmentVariable("servicePrincipalPassword", $servicePrincipalPassword) -[Environment]::SetEnvironmentVariable("servicePrincipalTenant", $servicePrincipalTenant) - - -Write-Host "" -Write-Host "Starting solution locally using docker compose." -Write-Host "" - -docker compose -f ./compose.yaml up \ No newline at end of file diff --git a/deploy/aca/start-compose.sh b/deploy/aca/start-compose.sh deleted file mode 100644 index be10276..0000000 --- a/deploy/aca/start-compose.sh +++ /dev/null @@ -1,60 +0,0 @@ -echo "" -echo "Loading azd .env file from current environment" -echo "" - -while IFS='=' read -r key value; do - value=$(echo "$value" | sed 's/^"//' | sed 's/"$//') - export "$key=$value" - echo "export $key=$value" -done <' -// minimumCount: 1 -// maximumCount: 3 -// } -// ] - -var defaultWorkloadProfile = [ - { - workloadProfileType: 'Consumption' - name: 'Consumption' - } -] - -var effectiveWorkloadProfiles = workloadProfiles != [] ? concat(defaultWorkloadProfile, workloadProfiles) : defaultWorkloadProfile - -resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' = { - name: name - location: location - tags: tags - properties: { - zoneRedundant: zoneRedundant - appLogsConfiguration: { - destination: 'log-analytics' - logAnalyticsConfiguration: { - customerId: logAnalyticsWorkspace.properties.customerId - sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey - } - } - workloadProfiles: effectiveWorkloadProfiles - daprAIInstrumentationKey: daprEnabled && !empty(applicationInsightsName) ? applicationInsights.properties.InstrumentationKey : '' - } -} - -resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = { - name: logAnalyticsWorkspaceName -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (daprEnabled && !empty(applicationInsightsName)) { - name: applicationInsightsName -} - -output defaultDomain string = containerAppsEnvironment.properties.defaultDomain -output id string = containerAppsEnvironment.id -output name string = containerAppsEnvironment.name diff --git a/deploy/shared/host/container-apps.bicep b/deploy/shared/host/container-apps.bicep deleted file mode 100644 index f3f7dad..0000000 --- a/deploy/shared/host/container-apps.bicep +++ /dev/null @@ -1,38 +0,0 @@ -metadata description = 'Creates an Azure Container Registry and an Azure Container Apps environment.' -param name string -param location string = resourceGroup().location -param tags object = {} - -param containerAppsEnvironmentName string -param containerRegistryName string -param containerRegistryResourceGroupName string = '' -param logAnalyticsWorkspaceName string -param applicationInsightsName string = '' - -module containerAppsEnvironment 'container-apps-environment.bicep' = { - name: '${name}-container-apps-environment' - params: { - name: containerAppsEnvironmentName - location: location - tags: tags - logAnalyticsWorkspaceName: logAnalyticsWorkspaceName - applicationInsightsName: applicationInsightsName - } -} - -module containerRegistry 'container-registry.bicep' = { - name: '${name}-container-registry' - scope: !empty(containerRegistryResourceGroupName) ? resourceGroup(containerRegistryResourceGroupName) : resourceGroup() - params: { - name: containerRegistryName - location: location - tags: tags - } -} - -output defaultDomain string = containerAppsEnvironment.outputs.defaultDomain -output environmentName string = containerAppsEnvironment.outputs.name -output environmentId string = containerAppsEnvironment.outputs.id - -output registryLoginServer string = containerRegistry.outputs.loginServer -output registryName string = containerRegistry.outputs.name diff --git a/deploy/shared/host/container-registry.bicep b/deploy/shared/host/container-registry.bicep deleted file mode 100644 index 9c64531..0000000 --- a/deploy/shared/host/container-registry.bicep +++ /dev/null @@ -1,83 +0,0 @@ -metadata description = 'Creates an Azure Container Registry.' -param name string -param location string = resourceGroup().location -param tags object = {} - -@description('Indicates whether admin user is enabled') -param adminUserEnabled bool = false - -@description('Indicates whether anonymous pull is enabled') -param anonymousPullEnabled bool = false - -@description('Indicates whether data endpoint is enabled') -param dataEndpointEnabled bool = false - -@description('Encryption settings') -param encryption object = { - status: 'disabled' -} - -@description('Options for bypassing network rules') -param networkRuleBypassOptions string = 'AzureServices' - -@description('Public network access setting') -param publicNetworkAccess string = 'Enabled' - -@description('SKU settings') -param sku object = { - name: 'Basic' -} - -@description('Zone redundancy setting') -param zoneRedundancy string = 'Disabled' - -@description('The log analytics workspace ID used for logging and monitoring') -param workspaceId string = '' - -// 2022-02-01-preview needed for anonymousPullEnabled -resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' = { - name: name - location: location - tags: tags - sku: sku - properties: { - adminUserEnabled: adminUserEnabled - anonymousPullEnabled: anonymousPullEnabled - dataEndpointEnabled: dataEndpointEnabled - encryption: encryption - networkRuleBypassOptions: networkRuleBypassOptions - publicNetworkAccess: publicNetworkAccess - zoneRedundancy: zoneRedundancy - } -} - -// TODO: Update diagnostics to be its own module -// Blocking issue: https://github.com/Azure/bicep/issues/622 -// Unable to pass in a `resource` scope or unable to use string interpolation in resource types -resource diagnostics 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty(workspaceId)) { - name: 'registry-diagnostics' - scope: containerRegistry - properties: { - workspaceId: workspaceId - logs: [ - { - category: 'ContainerRegistryRepositoryEvents' - enabled: true - } - { - category: 'ContainerRegistryLoginEvents' - enabled: true - } - ] - metrics: [ - { - category: 'AllMetrics' - enabled: true - timeGrain: 'PT1M' - } - ] - } -} - -output loginServer string = containerRegistry.properties.loginServer -output name string = containerRegistry.name diff --git a/deploy/shared/host/functions.bicep b/deploy/shared/host/functions.bicep deleted file mode 100644 index 7070a2c..0000000 --- a/deploy/shared/host/functions.bicep +++ /dev/null @@ -1,86 +0,0 @@ -metadata description = 'Creates an Azure Function in an existing Azure App Service plan.' -param name string -param location string = resourceGroup().location -param tags object = {} - -// Reference Properties -param applicationInsightsName string = '' -param appServicePlanId string -param keyVaultName string = '' -param managedIdentity bool = !empty(keyVaultName) -param storageAccountName string - -// Runtime Properties -@allowed([ - 'dotnet', 'dotnetcore', 'dotnet-isolated', 'node', 'python', 'java', 'powershell', 'custom' -]) -param runtimeName string -param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}' -param runtimeVersion string - -// Function Settings -@allowed([ - '~4', '~3', '~2', '~1' -]) -param extensionVersion string = '~4' - -// Microsoft.Web/sites Properties -param kind string = 'functionapp,linux' - -// Microsoft.Web/sites/config -param allowedOrigins array = [] -param alwaysOn bool = true -param appCommandLine string = '' -@secure() -param appSettings object = {} -param clientAffinityEnabled bool = false -param enableOryxBuild bool = contains(kind, 'linux') -param functionAppScaleLimit int = -1 -param linuxFxVersion string = runtimeNameAndVersion -param minimumElasticInstanceCount int = -1 -param numberOfWorkers int = -1 -param scmDoBuildDuringDeployment bool = true -param use32BitWorkerProcess bool = false -param healthCheckPath string = '' - -module functions 'appservice.bicep' = { - name: '${name}-functions' - params: { - name: name - location: location - tags: tags - allowedOrigins: allowedOrigins - alwaysOn: alwaysOn - appCommandLine: appCommandLine - applicationInsightsName: applicationInsightsName - appServicePlanId: appServicePlanId - appSettings: union(appSettings, { - AzureWebJobsStorage: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}' - FUNCTIONS_EXTENSION_VERSION: extensionVersion - FUNCTIONS_WORKER_RUNTIME: runtimeName - }) - clientAffinityEnabled: clientAffinityEnabled - enableOryxBuild: enableOryxBuild - functionAppScaleLimit: functionAppScaleLimit - healthCheckPath: healthCheckPath - keyVaultName: keyVaultName - kind: kind - linuxFxVersion: linuxFxVersion - managedIdentity: managedIdentity - minimumElasticInstanceCount: minimumElasticInstanceCount - numberOfWorkers: numberOfWorkers - runtimeName: runtimeName - runtimeVersion: runtimeVersion - runtimeNameAndVersion: runtimeNameAndVersion - scmDoBuildDuringDeployment: scmDoBuildDuringDeployment - use32BitWorkerProcess: use32BitWorkerProcess - } -} - -resource storage 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { - name: storageAccountName -} - -output identityPrincipalId string = managedIdentity ? functions.outputs.identityPrincipalId : '' -output name string = functions.outputs.name -output uri string = functions.outputs.uri diff --git a/deploy/shared/monitor/applicationinsights-dashboard.bicep b/deploy/shared/monitor/applicationinsights-dashboard.bicep deleted file mode 100644 index d082e66..0000000 --- a/deploy/shared/monitor/applicationinsights-dashboard.bicep +++ /dev/null @@ -1,1236 +0,0 @@ -metadata description = 'Creates a dashboard for an Application Insights instance.' -param name string -param applicationInsightsName string -param location string = resourceGroup().location -param tags object = {} - -// 2020-09-01-preview because that is the latest valid version -resource applicationInsightsDashboard 'Microsoft.Portal/dashboards@2020-09-01-preview' = { - name: name - location: location - tags: tags - properties: { - lenses: [ - { - order: 0 - parts: [ - { - position: { - x: 0 - y: 0 - colSpan: 2 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'id' - value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - { - name: 'Version' - value: '1.0' - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/AspNetOverviewPinnedPart' - asset: { - idInputName: 'id' - type: 'ApplicationInsights' - } - defaultMenuItemId: 'overview' - } - } - { - position: { - x: 2 - y: 0 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ComponentId' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'Version' - value: '1.0' - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/ProactiveDetectionAsyncPart' - asset: { - idInputName: 'ComponentId' - type: 'ApplicationInsights' - } - defaultMenuItemId: 'ProactiveDetection' - } - } - { - position: { - x: 3 - y: 0 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ComponentId' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'ResourceId' - value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/QuickPulseButtonSmallPart' - asset: { - idInputName: 'ComponentId' - type: 'ApplicationInsights' - } - } - } - { - position: { - x: 4 - y: 0 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ComponentId' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'TimeContext' - value: { - durationMs: 86400000 - endTime: null - createdTime: '2018-05-04T01:20:33.345Z' - isInitialTime: true - grain: 1 - useDashboardTimeRange: false - } - } - { - name: 'Version' - value: '1.0' - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/AvailabilityNavButtonPart' - asset: { - idInputName: 'ComponentId' - type: 'ApplicationInsights' - } - } - } - { - position: { - x: 5 - y: 0 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ComponentId' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'TimeContext' - value: { - durationMs: 86400000 - endTime: null - createdTime: '2018-05-08T18:47:35.237Z' - isInitialTime: true - grain: 1 - useDashboardTimeRange: false - } - } - { - name: 'ConfigurationId' - value: '78ce933e-e864-4b05-a27b-71fd55a6afad' - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/AppMapButtonPart' - asset: { - idInputName: 'ComponentId' - type: 'ApplicationInsights' - } - } - } - { - position: { - x: 0 - y: 1 - colSpan: 3 - rowSpan: 1 - } - metadata: { - inputs: [] - type: 'Extension/HubsExtension/PartType/MarkdownPart' - settings: { - content: { - settings: { - content: '# Usage' - title: '' - subtitle: '' - } - } - } - } - } - { - position: { - x: 3 - y: 1 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ComponentId' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'TimeContext' - value: { - durationMs: 86400000 - endTime: null - createdTime: '2018-05-04T01:22:35.782Z' - isInitialTime: true - grain: 1 - useDashboardTimeRange: false - } - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/UsageUsersOverviewPart' - asset: { - idInputName: 'ComponentId' - type: 'ApplicationInsights' - } - } - } - { - position: { - x: 4 - y: 1 - colSpan: 3 - rowSpan: 1 - } - metadata: { - inputs: [] - type: 'Extension/HubsExtension/PartType/MarkdownPart' - settings: { - content: { - settings: { - content: '# Reliability' - title: '' - subtitle: '' - } - } - } - } - } - { - position: { - x: 7 - y: 1 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ResourceId' - value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - { - name: 'DataModel' - value: { - version: '1.0.0' - timeContext: { - durationMs: 86400000 - createdTime: '2018-05-04T23:42:40.072Z' - isInitialTime: false - grain: 1 - useDashboardTimeRange: false - } - } - isOptional: true - } - { - name: 'ConfigurationId' - value: '8a02f7bf-ac0f-40e1-afe9-f0e72cfee77f' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/CuratedBladeFailuresPinnedPart' - isAdapter: true - asset: { - idInputName: 'ResourceId' - type: 'ApplicationInsights' - } - defaultMenuItemId: 'failures' - } - } - { - position: { - x: 8 - y: 1 - colSpan: 3 - rowSpan: 1 - } - metadata: { - inputs: [] - type: 'Extension/HubsExtension/PartType/MarkdownPart' - settings: { - content: { - settings: { - content: '# Responsiveness\r\n' - title: '' - subtitle: '' - } - } - } - } - } - { - position: { - x: 11 - y: 1 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ResourceId' - value: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - { - name: 'DataModel' - value: { - version: '1.0.0' - timeContext: { - durationMs: 86400000 - createdTime: '2018-05-04T23:43:37.804Z' - isInitialTime: false - grain: 1 - useDashboardTimeRange: false - } - } - isOptional: true - } - { - name: 'ConfigurationId' - value: '2a8ede4f-2bee-4b9c-aed9-2db0e8a01865' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/CuratedBladePerformancePinnedPart' - isAdapter: true - asset: { - idInputName: 'ResourceId' - type: 'ApplicationInsights' - } - defaultMenuItemId: 'performance' - } - } - { - position: { - x: 12 - y: 1 - colSpan: 3 - rowSpan: 1 - } - metadata: { - inputs: [] - type: 'Extension/HubsExtension/PartType/MarkdownPart' - settings: { - content: { - settings: { - content: '# Browser' - title: '' - subtitle: '' - } - } - } - } - } - { - position: { - x: 15 - y: 1 - colSpan: 1 - rowSpan: 1 - } - metadata: { - inputs: [ - { - name: 'ComponentId' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'MetricsExplorerJsonDefinitionId' - value: 'BrowserPerformanceTimelineMetrics' - } - { - name: 'TimeContext' - value: { - durationMs: 86400000 - createdTime: '2018-05-08T12:16:27.534Z' - isInitialTime: false - grain: 1 - useDashboardTimeRange: false - } - } - { - name: 'CurrentFilter' - value: { - eventTypes: [ - 4 - 1 - 3 - 5 - 2 - 6 - 13 - ] - typeFacets: {} - isPermissive: false - } - } - { - name: 'id' - value: { - Name: applicationInsights.name - SubscriptionId: subscription().subscriptionId - ResourceGroup: resourceGroup().name - } - } - { - name: 'Version' - value: '1.0' - } - ] - #disable-next-line BCP036 - type: 'Extension/AppInsightsExtension/PartType/MetricsExplorerBladePinnedPart' - asset: { - idInputName: 'ComponentId' - type: 'ApplicationInsights' - } - defaultMenuItemId: 'browser' - } - } - { - position: { - x: 0 - y: 2 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'sessions/count' - aggregationType: 5 - namespace: 'microsoft.insights/components/kusto' - metricVisualization: { - displayName: 'Sessions' - color: '#47BDF5' - } - } - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'users/count' - aggregationType: 5 - namespace: 'microsoft.insights/components/kusto' - metricVisualization: { - displayName: 'Users' - color: '#7E58FF' - } - } - ] - title: 'Unique sessions and users' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - openBladeOnClick: { - openBlade: true - destinationBlade: { - extensionName: 'HubsExtension' - bladeName: 'ResourceMenuBlade' - parameters: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - menuid: 'segmentationUsers' - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 4 - y: 2 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'requests/failed' - aggregationType: 7 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Failed requests' - color: '#EC008C' - } - } - ] - title: 'Failed requests' - visualization: { - chartType: 3 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - openBladeOnClick: { - openBlade: true - destinationBlade: { - extensionName: 'HubsExtension' - bladeName: 'ResourceMenuBlade' - parameters: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - menuid: 'failures' - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 8 - y: 2 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'requests/duration' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Server response time' - color: '#00BCF2' - } - } - ] - title: 'Server response time' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - openBladeOnClick: { - openBlade: true - destinationBlade: { - extensionName: 'HubsExtension' - bladeName: 'ResourceMenuBlade' - parameters: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - menuid: 'performance' - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 12 - y: 2 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'browserTimings/networkDuration' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Page load network connect time' - color: '#7E58FF' - } - } - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'browserTimings/processingDuration' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Client processing time' - color: '#44F1C8' - } - } - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'browserTimings/sendDuration' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Send request time' - color: '#EB9371' - } - } - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'browserTimings/receiveDuration' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Receiving response time' - color: '#0672F1' - } - } - ] - title: 'Average page load time breakdown' - visualization: { - chartType: 3 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 0 - y: 5 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'availabilityResults/availabilityPercentage' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Availability' - color: '#47BDF5' - } - } - ] - title: 'Average availability' - visualization: { - chartType: 3 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - openBladeOnClick: { - openBlade: true - destinationBlade: { - extensionName: 'HubsExtension' - bladeName: 'ResourceMenuBlade' - parameters: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - menuid: 'availability' - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 4 - y: 5 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'exceptions/server' - aggregationType: 7 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Server exceptions' - color: '#47BDF5' - } - } - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'dependencies/failed' - aggregationType: 7 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Dependency failures' - color: '#7E58FF' - } - } - ] - title: 'Server exceptions and Dependency failures' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 8 - y: 5 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'performanceCounters/processorCpuPercentage' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Processor time' - color: '#47BDF5' - } - } - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'performanceCounters/processCpuPercentage' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Process CPU' - color: '#7E58FF' - } - } - ] - title: 'Average processor and process CPU utilization' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 12 - y: 5 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'exceptions/browser' - aggregationType: 7 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Browser exceptions' - color: '#47BDF5' - } - } - ] - title: 'Browser exceptions' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 0 - y: 8 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'availabilityResults/count' - aggregationType: 7 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Availability test results count' - color: '#47BDF5' - } - } - ] - title: 'Availability test results count' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 4 - y: 8 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'performanceCounters/processIOBytesPerSecond' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Process IO rate' - color: '#47BDF5' - } - } - ] - title: 'Average process I/O rate' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - { - position: { - x: 8 - y: 8 - colSpan: 4 - rowSpan: 3 - } - metadata: { - inputs: [ - { - name: 'options' - value: { - chart: { - metrics: [ - { - resourceMetadata: { - id: '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.Insights/components/${applicationInsights.name}' - } - name: 'performanceCounters/memoryAvailableBytes' - aggregationType: 4 - namespace: 'microsoft.insights/components' - metricVisualization: { - displayName: 'Available memory' - color: '#47BDF5' - } - } - ] - title: 'Average available memory' - visualization: { - chartType: 2 - legendVisualization: { - isVisible: true - position: 2 - hideSubtitle: false - } - axisVisualization: { - x: { - isVisible: true - axisType: 2 - } - y: { - isVisible: true - axisType: 1 - } - } - } - } - } - } - { - name: 'sharedTimeRange' - isOptional: true - } - ] - #disable-next-line BCP036 - type: 'Extension/HubsExtension/PartType/MonitorChartPart' - settings: {} - } - } - ] - } - ] - } -} - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { - name: applicationInsightsName -} diff --git a/deploy/shared/monitor/applicationinsights.bicep b/deploy/shared/monitor/applicationinsights.bicep deleted file mode 100644 index 46e9455..0000000 --- a/deploy/shared/monitor/applicationinsights.bicep +++ /dev/null @@ -1,30 +0,0 @@ -metadata description = 'Creates an Application Insights instance based on an existing Log Analytics workspace.' -param name string -param dashboardName string = '' -param location string = resourceGroup().location -param tags object = {} -param logAnalyticsWorkspaceId string - -resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { - name: name - location: location - tags: tags - kind: 'web' - properties: { - Application_Type: 'web' - WorkspaceResourceId: logAnalyticsWorkspaceId - } -} - -module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = if (!empty(dashboardName)) { - name: 'application-insights-dashboard' - params: { - name: dashboardName - location: location - applicationInsightsName: applicationInsights.name - } -} - -output connectionString string = applicationInsights.properties.ConnectionString -output instrumentationKey string = applicationInsights.properties.InstrumentationKey -output name string = applicationInsights.name diff --git a/deploy/shared/monitor/loganalytics.bicep b/deploy/shared/monitor/loganalytics.bicep deleted file mode 100644 index 33f9dc2..0000000 --- a/deploy/shared/monitor/loganalytics.bicep +++ /dev/null @@ -1,22 +0,0 @@ -metadata description = 'Creates a Log Analytics workspace.' -param name string -param location string = resourceGroup().location -param tags object = {} - -resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { - name: name - location: location - tags: tags - properties: any({ - retentionInDays: 30 - features: { - searchVersion: 1 - } - sku: { - name: 'PerGB2018' - } - }) -} - -output id string = logAnalytics.id -output name string = logAnalytics.name diff --git a/deploy/shared/monitor/monitoring.bicep b/deploy/shared/monitor/monitoring.bicep deleted file mode 100644 index 6bb05b0..0000000 --- a/deploy/shared/monitor/monitoring.bicep +++ /dev/null @@ -1,32 +0,0 @@ -metadata description = 'Creates an Application Insights instance and a Log Analytics workspace.' -param logAnalyticsName string -param applicationInsightsName string -param applicationInsightsDashboardName string = '' -param location string = resourceGroup().location -param tags object = {} - -module logAnalytics 'loganalytics.bicep' = { - name: 'loganalytics' - params: { - name: logAnalyticsName - location: location - tags: tags - } -} - -module applicationInsights 'applicationinsights.bicep' = { - name: 'applicationinsights' - params: { - name: applicationInsightsName - location: location - tags: tags - dashboardName: applicationInsightsDashboardName - logAnalyticsWorkspaceId: logAnalytics.outputs.id - } -} - -output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString -output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey -output applicationInsightsName string = applicationInsights.outputs.name -output logAnalyticsWorkspaceId string = logAnalytics.outputs.id -output logAnalyticsWorkspaceName string = logAnalytics.outputs.name diff --git a/deploy/shared/search/search-services.bicep b/deploy/shared/search/search-services.bicep deleted file mode 100644 index e7747e5..0000000 --- a/deploy/shared/search/search-services.bicep +++ /dev/null @@ -1,63 +0,0 @@ -metadata description = 'Creates an Azure AI Search instance.' -param name string -param location string = resourceGroup().location -param tags object = {} - -param sku object = { - name: 'standard' -} - -param authOptions object = {} -param disableLocalAuth bool = false -param disabledDataExfiltrationOptions array = [] -param encryptionWithCmk object = { - enforcement: 'Unspecified' -} -@allowed([ - 'default' - 'highDensity' -]) -param hostingMode string = 'default' -param networkRuleSet object = { - bypass: 'None' - ipRules: [] -} -param partitionCount int = 1 -@allowed([ - 'enabled' - 'disabled' -]) -param publicNetworkAccess string = 'enabled' -param replicaCount int = 1 -@allowed([ - 'disabled' - 'free' - 'standard' -]) -param semanticSearch string = 'disabled' - -resource search 'Microsoft.Search/searchServices@2021-04-01-preview' = { - name: name - location: location - tags: tags - identity: { - type: 'SystemAssigned' - } - properties: { - authOptions: authOptions - disableLocalAuth: disableLocalAuth - disabledDataExfiltrationOptions: disabledDataExfiltrationOptions - encryptionWithCmk: encryptionWithCmk - hostingMode: hostingMode - networkRuleSet: networkRuleSet - partitionCount: partitionCount - publicNetworkAccess: publicNetworkAccess - replicaCount: replicaCount - semanticSearch: semanticSearch - } - sku: sku -} - -output id string = search.id -output endpoint string = 'https://${name}.search.windows.net/' -output name string = search.name diff --git a/deploy/shared/security/keyvault-access.bicep b/deploy/shared/security/keyvault-access.bicep deleted file mode 100644 index 316775f..0000000 --- a/deploy/shared/security/keyvault-access.bicep +++ /dev/null @@ -1,22 +0,0 @@ -metadata description = 'Assigns an Azure Key Vault access policy.' -param name string = 'add' - -param keyVaultName string -param permissions object = { secrets: [ 'get', 'list' ] } -param principalId string - -resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = { - parent: keyVault - name: name - properties: { - accessPolicies: [ { - objectId: principalId - tenantId: subscription().tenantId - permissions: permissions - } ] - } -} - -resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { - name: keyVaultName -} diff --git a/deploy/shared/security/keyvault-secret.bicep b/deploy/shared/security/keyvault-secret.bicep deleted file mode 100644 index 7441b29..0000000 --- a/deploy/shared/security/keyvault-secret.bicep +++ /dev/null @@ -1,31 +0,0 @@ -metadata description = 'Creates or updates a secret in an Azure Key Vault.' -param name string -param tags object = {} -param keyVaultName string -param contentType string = 'string' -@description('The value of the secret. Provide only derived values like blob storage access, but do not hard code any secrets in your templates') -@secure() -param secretValue string - -param enabled bool = true -param exp int = 0 -param nbf int = 0 - -resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { - name: name - tags: tags - parent: keyVault - properties: { - attributes: { - enabled: enabled - exp: exp - nbf: nbf - } - contentType: contentType - value: secretValue - } -} - -resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { - name: keyVaultName -} diff --git a/deploy/shared/security/keyvault.bicep b/deploy/shared/security/keyvault.bicep deleted file mode 100644 index 314a1db..0000000 --- a/deploy/shared/security/keyvault.bicep +++ /dev/null @@ -1,26 +0,0 @@ -metadata description = 'Creates an Azure Key Vault.' -param name string -param location string = resourceGroup().location -param tags object = {} - -param principalId string = '' - -resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { - name: name - location: location - tags: tags - properties: { - tenantId: subscription().tenantId - sku: { family: 'A', name: 'standard' } - accessPolicies: !empty(principalId) ? [ - { - objectId: principalId - permissions: { secrets: [ 'get', 'list' ] } - tenantId: subscription().tenantId - } - ] : [] - } -} - -output endpoint string = keyVault.properties.vaultUri -output name string = keyVault.name diff --git a/deploy/shared/security/registry-access.bicep b/deploy/shared/security/registry-access.bicep deleted file mode 100644 index 5335efa..0000000 --- a/deploy/shared/security/registry-access.bicep +++ /dev/null @@ -1,19 +0,0 @@ -metadata description = 'Assigns ACR Pull permissions to access an Azure Container Registry.' -param containerRegistryName string -param principalId string - -var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') - -resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - scope: containerRegistry // Use when specifying a scope that is different than the deployment scope - name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) - properties: { - roleDefinitionId: acrPullRole - principalType: 'ServicePrincipal' - principalId: principalId - } -} - -resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' existing = { - name: containerRegistryName -} diff --git a/deploy/shared/security/role.bicep b/deploy/shared/security/role.bicep deleted file mode 100644 index 0b30cfd..0000000 --- a/deploy/shared/security/role.bicep +++ /dev/null @@ -1,21 +0,0 @@ -metadata description = 'Creates a role assignment for a service principal.' -param principalId string - -@allowed([ - 'Device' - 'ForeignGroup' - 'Group' - 'ServicePrincipal' - 'User' -]) -param principalType string = 'ServicePrincipal' -param roleDefinitionId string - -resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) - properties: { - principalId: principalId - principalType: principalType - roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) - } -} diff --git a/deploy/shared/servicebus/servicebus-queue.bicep b/deploy/shared/servicebus/servicebus-queue.bicep deleted file mode 100644 index b6f5efa..0000000 --- a/deploy/shared/servicebus/servicebus-queue.bicep +++ /dev/null @@ -1,44 +0,0 @@ -param location string = resourceGroup().location -param namespaceName string -param skuName string = 'Basic' -param queueName string -param deadLetterQueueName string = '${queueName}-dlq' -param tags object = {} - -resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2022-10-01-preview' = { - name: namespaceName - location: location - tags: tags - sku: { - name: skuName - } -} - -resource deadLetterQueue 'Microsoft.ServiceBus/namespaces/queues@2022-10-01-preview' = { - name: deadLetterQueueName - parent: serviceBusNamespace - properties: { - requiresDuplicateDetection: false - requiresSession: false - enablePartitioning: false - } -} - -resource queues 'Microsoft.ServiceBus/namespaces/queues@2022-10-01-preview' = { - parent: serviceBusNamespace - name: queueName - dependsOn: [ - deadLetterQueue - ] - properties: { - lockDuration: 'PT3M' - forwardDeadLetteredMessagesTo: deadLetterQueueName - } -} - -output name string = serviceBusNamespace.name -output skuName string = serviceBusNamespace.sku.name -output queueName string = queues.name - - - diff --git a/deploy/shared/storage/storage-account.bicep b/deploy/shared/storage/storage-account.bicep deleted file mode 100644 index 4b6febb..0000000 --- a/deploy/shared/storage/storage-account.bicep +++ /dev/null @@ -1,64 +0,0 @@ -metadata description = 'Creates an Azure storage account.' -param name string -param location string = resourceGroup().location -param tags object = {} - -@allowed([ - 'Cool' - 'Hot' - 'Premium' ]) -param accessTier string = 'Hot' -param allowBlobPublicAccess bool = true -param allowCrossTenantReplication bool = true -param allowSharedKeyAccess bool = true -param containers array = [] -param defaultToOAuthAuthentication bool = false -param deleteRetentionPolicy object = {} -@allowed([ 'AzureDnsZone', 'Standard' ]) -param dnsEndpointType string = 'Standard' -param kind string = 'StorageV2' -param minimumTlsVersion string = 'TLS1_2' -param supportsHttpsTrafficOnly bool = true -param networkAcls object = { - bypass: 'AzureServices' - defaultAction: 'Allow' -} -@allowed([ 'Enabled', 'Disabled' ]) -param publicNetworkAccess string = 'Enabled' -param sku object = { name: 'Standard_LRS' } - -resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = { - name: name - location: location - tags: tags - kind: kind - sku: sku - properties: { - accessTier: accessTier - allowBlobPublicAccess: allowBlobPublicAccess - allowCrossTenantReplication: allowCrossTenantReplication - allowSharedKeyAccess: allowSharedKeyAccess - defaultToOAuthAuthentication: defaultToOAuthAuthentication - dnsEndpointType: dnsEndpointType - minimumTlsVersion: minimumTlsVersion - networkAcls: networkAcls - publicNetworkAccess: publicNetworkAccess - supportsHttpsTrafficOnly: supportsHttpsTrafficOnly - } - - resource blobServices 'blobServices' = if (!empty(containers)) { - name: 'default' - properties: { - deleteRetentionPolicy: deleteRetentionPolicy - } - resource container 'containers' = [for container in containers: { - name: container.name - properties: { - publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None' - } - }] - } -} - -output name string = storage.name -output primaryEndpoints object = storage.properties.primaryEndpoints