Skip to main content
Glama
main.bicep3.31 kB
@description('The location to deploy resources to.') param location string = resourceGroup().location @description('The name of the Container App.') param containerAppName string = 'mcp-kql-server' @description('The name of the Container Registry.') param containerRegistryName string @description('The image to deploy (e.g. myregistry.azurecr.io/mcp-kql-server:latest).') param containerImage string @description('The Kusto Cluster URL.') param kustoClusterUrl string @description('The Kusto Database Name.') param kustoDatabaseName string = 'DefaultDB' resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2022-10-01' = { name: '${containerAppName}-logs' location: location properties: { sku: { name: 'PerGB2018' } retentionInDays: 30 } } resource containerAppEnv 'Microsoft.App/managedEnvironments@2023-05-01' = { name: '${containerAppName}-env' location: location properties: { appLogsConfiguration: { destination: 'log-analytics' logAnalyticsConfiguration: { customerId: logAnalytics.properties.customerId sharedKey: logAnalytics.listKeys().primarySharedKey } } } } resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { name: '${containerAppName}-id' location: location } resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { name: containerRegistryName } resource containerApp 'Microsoft.App/containerApps@2023-05-01' = { name: containerAppName location: location identity: { type: 'UserAssigned' userAssignedIdentities: { '${managedIdentity.id}': {} } } properties: { managedEnvironmentId: containerAppEnv.id configuration: { ingress: { external: true targetPort: 8000 transport: 'auto' } registries: [ { server: containerRegistry.properties.loginServer identity: managedIdentity.id } ] secrets: [] } template: { containers: [ { name: containerAppName image: containerImage env: [ { name: 'KUSTO_CLUSTER_URL' value: kustoClusterUrl } { name: 'KUSTO_DATABASE' value: kustoDatabaseName } { name: 'AZURE_CLIENT_ID' value: managedIdentity.properties.clientId } { name: 'LOG_LEVEL' value: 'INFO' } ] resources: { cpu: json('0.5') memory: '1.0Gi' } } ] scale: { minReplicas: 1 maxReplicas: 5 rules: [ { name: 'http-requests' custom: { type: 'http' metadata: { concurrentRequests: '10' } } } ] } } } } // Output the Managed Identity Principal ID for RBAC assignment output managedIdentityPrincipalId string = managedIdentity.properties.principalId output managedIdentityClientId string = managedIdentity.properties.clientId output containerAppUrl string = containerApp.properties.configuration.ingress.fqdn

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/4R9UN/mcp-kql-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server