Skip to content

Commit

Permalink
Fix Application Insight env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ReedOnly committed Jan 29, 2021
1 parent e885b62 commit 30b3fc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- '3000:3000'
environment:
- API_URL=http://localhost:5000
- ApplicationInsights__InstrumentationKey
- APP_INSIGHTS_KEY
backend:
build: backend
ports:
Expand Down
13 changes: 6 additions & 7 deletions frontend/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
const webpack = require('webpack')


let isProduction = false
if (process.env.BUILD_MODE && process.env.BUILD_MODE === "production") {
if (process.env.BUILD_MODE && process.env.BUILD_MODE === 'production') {
isProduction = true
}
const mode = isProduction ? 'production' : 'development'

const API_URL = process.env.API_URL || 'http://localhost:5000'
const AD_APP_ID = process.env.AD_CLIENT_ID || '8829d4ca-93e8-499a-8ce1-bc0ef4840176'
const APP_INSIGHTS = process.env.ApplicationInsights__InstrumentationKey || ''
const APP_INSIGHTS_KEY = process.env.APP_INSIGHTS_KEY || ''

console.log("--- MODE:", mode, "API_URL:", API_URL)
console.log('--- MODE:', mode, 'API_URL:', API_URL)

module.exports = {
mode: mode,
plugins: [
new webpack.DefinePlugin({
API_URL: JSON.stringify(API_URL),
AD_APP_ID: JSON.stringify(AD_APP_ID),
APP_INSIGHTS: JSON.stringify(APP_INSIGHTS)
})
]
APP_INSIGHTS: JSON.stringify(APP_INSIGHTS_KEY),
}),
],
}
2 changes: 1 addition & 1 deletion radixconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
port: 3000
publicPort: http
variables:
ApplicationInsights__InstrumentationKey: 6f08fb54-d348-44cb-9fa6-be2c9e29d419
APP_INSIGHTS_KEY: 6f08fb54-d348-44cb-9fa6-be2c9e29d419
environmentConfig:
- environment: dev
resources:
Expand Down

0 comments on commit 30b3fc6

Please sign in to comment.