Skip to content

Commit

Permalink
Link app insights to app service (pulumi#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailshilkov committed Aug 5, 2020
1 parent a555402 commit b57cce8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
7 changes: 4 additions & 3 deletions azure-go-appservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ func main() {
Location: resourceGroup.Location,
AppServicePlanId: appServicePlan.ID(),
AppSettings: pulumi.StringMap{
"WEBSITE_RUN_FROM_ZIP": codeBlobURL,
"ApplicationInsights:InstrumentationKey": appInsights.InstrumentationKey,
"APPINSIGHTS_INSTRUMENTATIONKEY": appInsights.InstrumentationKey,
"APPINSIGHTS_INSTRUMENTATIONKEY": appInsights.InstrumentationKey,
"APPLICATIONINSIGHTS_CONNECTION_STRING": pulumi.Sprintf("InstrumentationKey=%s", appInsights.InstrumentationKey),
"ApplicationInsightsAgent_EXTENSION_VERSION": pulumi.String("~2"),
"WEBSITE_RUN_FROM_PACKAGE": codeBlobURL,
},
ConnectionStrings: appservice.AppServiceConnectionStringArray{
appservice.AppServiceConnectionStringArgs{
Expand Down
7 changes: 5 additions & 2 deletions azure-py-appservice/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ def get_sas(args):
resource_group_name=resource_group.name,
app_service_plan_id=app_service_plan.id,
app_settings={
"WEBSITE_RUN_FROM_PACKAGE": signed_blob_url,
"ApplicationInsights:InstrumentationKey": app_insights.instrumentation_key,
"APPINSIGHTS_INSTRUMENTATIONKEY": app_insights.instrumentation_key,
"APPLICATIONINSIGHTS_CONNECTION_STRING": app_insights.instrumentation_key.apply(
lambda key: "InstrumentationKey=" + key
),
"ApplicationInsightsAgent_EXTENSION_VERSION": "~2",
"WEBSITE_RUN_FROM_PACKAGE": signed_blob_url,
},
connection_strings=[{
"name": "db",
Expand Down
9 changes: 5 additions & 4 deletions azure-ts-appservice-devops/infra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ const app = new azure.appservice.AppService(`${prefix}-as`, {


appSettings: {
"WEBSITE_RUN_FROM_ZIP": codeBlobUrl,
"ApplicationInsights:InstrumentationKey": appInsights.instrumentationKey,
"APPINSIGHTS_INSTRUMENTATIONKEY": appInsights.instrumentationKey,
"ASPNETCORE_ENVIRONMENT": "Development",
APPINSIGHTS_INSTRUMENTATIONKEY: appInsights.instrumentationKey,
APPLICATIONINSIGHTS_CONNECTION_STRING: pulumi.interpolate`InstrumentationKey=${appInsights.instrumentationKey}`,
ApplicationInsightsAgent_EXTENSION_VERSION: "~2",
ASPNETCORE_ENVIRONMENT: "Development",
WEBSITE_RUN_FROM_PACKAGE: codeBlobUrl,
},

connectionStrings: [{
Expand Down
7 changes: 4 additions & 3 deletions azure-ts-appservice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ const app = new azure.appservice.AppService(`${prefix}-as`, {


appSettings: {
"WEBSITE_RUN_FROM_ZIP": codeBlobUrl,
"ApplicationInsights:InstrumentationKey": appInsights.instrumentationKey,
"APPINSIGHTS_INSTRUMENTATIONKEY": appInsights.instrumentationKey,
APPINSIGHTS_INSTRUMENTATIONKEY: appInsights.instrumentationKey,
APPLICATIONINSIGHTS_CONNECTION_STRING: pulumi.interpolate`InstrumentationKey=${appInsights.instrumentationKey}`,
ApplicationInsightsAgent_EXTENSION_VERSION: "~2",
WEBSITE_RUN_FROM_PACKAGE: codeBlobUrl,
},

connectionStrings: [{
Expand Down

0 comments on commit b57cce8

Please sign in to comment.