Files
web/apps/redis-api/ci/bicep/main.bicep
Joakim Jäderberg 814a1c534b Merged in fix/redis-api-set-sentry-environment-via-bicep (pull request #1981)
fix: set sentry environment through bicep deploys

* fix: set sentry environment through bicep deploys


Approved-by: Anton Gunnarsson
2025-05-06 13:06:28 +00:00

56 lines
1.3 KiB
Bicep

import { Environment, EnvironmentVar } from 'types.bicep'
targetScope = 'subscription'
param environment Environment
param containerImageTag string = 'latest'
param primaryApiKey string
param secondaryApiKey string
param sentryDSN string
param sentryEnabled string
param sentryTraceSampleRate string
@description('The location for the resource group')
param location string = 'westeurope'
resource rgRedisApi 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'rg-redis-api-${environment}'
location: location
}
module mi 'managedIdentity.bicep' = {
name: 'mi-redis-api-${environment}'
scope: rgRedisApi
params: {
principalName: 'mi-redis-api-${environment}'
location: location
}
}
module redis 'cache/redis.bicep' = {
name: 'redisCache'
scope: rgRedisApi
params: {
location: location
environment: environment
}
}
module containerApp 'app/main.bicep' = {
name: 'containerApp'
params: {
location: location
environment: environment
containerImageTag: containerImageTag
redisConnection: 'default:${redis.outputs.primaryAccessKey}@${redis.outputs.hostname}:6380'
primaryApiKey: primaryApiKey
secondaryApiKey: secondaryApiKey
sentryEnvironment: environment == 'prod' ? 'production' : 'test'
sentryDSN: sentryDSN
sentryEnabled: sentryEnabled
sentryTraceSampleRate: sentryTraceSampleRate
}
}