Skip to content

Commit 3be2d17

Browse files
Merge pull request #75 from microsoft/PSL-BUG-14644
fix: updated variable name
2 parents 268195c + 42b2367 commit 3be2d17

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ To add your newly created backend image:
177177
name: 'FRONTEND_SITE_NAME'
178178
value: 'https://<website Name>.azurewebsites.net'
179179

180-
name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
181-
value: <Application Insights Instrumentation Key>
180+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
181+
value: <Application Insights Connection String>
182182

183183
- Click 'Save' and deploy your new revision
184184

deploy/macae-continer-oc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.32.4.45862",
9-
"templateHash": "13282901028774763433"
9+
"templateHash": "14272651486454797588"
1010
}
1111
},
1212
"parameters": {
@@ -368,7 +368,7 @@
368368
"value": "[format('https://{0}.azurewebsites.net', format(variables('uniqueNameFormat'), 'frontend'))]"
369369
},
370370
{
371-
"name": "APPLICATIONINSIGHTS_INSTRUMENTATION_KEY",
371+
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
372372
"value": "[reference('appInsights').ConnectionString]"
373373
}
374374
]

deploy/macae-continer.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
280280
value: 'https://${format(uniqueNameFormat, 'frontend')}.azurewebsites.net'
281281
}
282282
{
283-
name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
283+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
284284
value: appInsights.properties.ConnectionString
285285
}
286286
]

src/backend/.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AZURE_OPENAI_ENDPOINT=
66
AZURE_OPENAI_MODEL_NAME=gpt-4o
77
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
88
AZURE_OPENAI_API_VERSION=2024-08-01-preview
9-
APPLICATIONINSIGHTS_INSTRUMENTATION_KEY=
9+
APPLICATIONINSIGHTS_CONNECTION_STRING=
1010

1111
BACKEND_API_URL='http://localhost:8000'
1212
FRONTEND_SITE_NAME='http://127.0.0.1:3000'

src/backend/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
# Check if the Application Insights Instrumentation Key is set in the environment variables
35-
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_INSTRUMENTATION_KEY")
35+
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
3636
if instrumentation_key:
3737
# Configure Application Insights if the Instrumentation Key is found
3838
configure_azure_monitor(connection_string=instrumentation_key)

src/backend/event_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def track_event_if_configured(event_name: str, event_data: dict):
7-
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_INSTRUMENTATION_KEY")
7+
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
88
if instrumentation_key:
99
track_event(event_name, event_data)
1010
else:

src/backend/tests/agents/test_human.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def setup_environment_variables():
1616
os.environ["COSMOSDB_KEY"] = "mock-key"
1717
os.environ["COSMOSDB_DATABASE"] = "mock-database"
1818
os.environ["COSMOSDB_CONTAINER"] = "mock-container"
19-
os.environ["APPLICATIONINSIGHTS_INSTRUMENTATION_KEY"] = "mock-instrumentation-key"
19+
os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"] = "mock-instrumentation-key"
2020
os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"] = "mock-deployment-name"
2121
os.environ["AZURE_OPENAI_API_VERSION"] = "2023-01-01"
2222
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://mock-openai-endpoint"
@@ -46,7 +46,7 @@ def ensure_env_variables(monkeypatch):
4646
"COSMOSDB_KEY": "mock-key",
4747
"COSMOSDB_DATABASE": "mock-database",
4848
"COSMOSDB_CONTAINER": "mock-container",
49-
"APPLICATIONINSIGHTS_INSTRUMENTATION_KEY": "mock-instrumentation-key",
49+
"APPLICATIONINSIGHTS_CONNECTION_STRING": "mock-instrumentation-key",
5050
"AZURE_OPENAI_DEPLOYMENT_NAME": "mock-deployment-name",
5151
"AZURE_OPENAI_API_VERSION": "2023-01-01",
5252
"AZURE_OPENAI_ENDPOINT": "https://mock-openai-endpoint",

src/backend/tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
os.environ["COSMOSDB_DATABASE"] = "mock-database"
1616
os.environ["COSMOSDB_CONTAINER"] = "mock-container"
1717
os.environ[
18-
"APPLICATIONINSIGHTS_INSTRUMENTATION_KEY"
18+
"APPLICATIONINSIGHTS_CONNECTION_STRING"
1919
] = "InstrumentationKey=mock-instrumentation-key;IngestionEndpoint=https://mock-ingestion-endpoint"
2020
os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"] = "mock-deployment-name"
2121
os.environ["AZURE_OPENAI_API_VERSION"] = "2023-01-01"

0 commit comments

Comments
 (0)