quinzee.cloud

Development edition · 16 November 2026. Commands using repository paths, Make targets or sample projects require access to the Quinzee source checkout. No public installer is available. Examples use disposable local environments.

Developer’s guide

29. Deploy monitoring with the application

Run the infrastructure workshop first. Each file below is complete and deploys at resource-group scope. Use a separate deployment name for each lesson so its operation history is easy to find.

Connect an Application Insights component to a workspace

A workspace stores telemetry; a component identifies its producer and points to that workspace. The resource reference makes the workspace a prerequisite. DisableLocalAuth: true requires a supported bearer token for ingestion rather than relying only on an instrumentation key.

Step 1: save the Bicep

The repository copy is examples/book-iac/monitoring.bicep. To experiment, save this complete sample to .local/book-iac/monitoring.bicep:

targetScope = 'resourceGroup'
param prefix string = 'booklab'
param location string = resourceGroup().location

resource workspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
  name: '${prefix}-logs'
  location: location
  properties: {
    sku: { name: 'PerGB2018' }
    retentionInDays: 30
  }
}
resource insights 'Microsoft.Insights/components@2020-02-02' = {
  name: '${prefix}-insights'
  location: location
  kind: 'web'
  properties: {
    Application_Type: 'web'
    WorkspaceResourceId: workspace.id
    DisableLocalAuth: true
  }
}
output workspaceId string = workspace.properties.customerId
output connectionString string = insights.properties.ConnectionString

Step 2: inspect the ARM equivalent

The compiler emits these resource objects. The surrounding template also contains the parameters and outputs declared above. Expressions in square brackets are evaluated by the deployment engine, not by your shell.

[
  {
    "type": "Microsoft.OperationalInsights/workspaces",
    "apiVersion": "2023-09-01",
    "name": "[format('{0}-logs', parameters('prefix'))]",
    "location": "[parameters('location')]",
    "properties": {
      "sku": {
        "name": "PerGB2018"
      },
      "retentionInDays": 30
    }
  },
  {
    "type": "Microsoft.Insights/components",
    "apiVersion": "2020-02-02",
    "name": "[format('{0}-insights', parameters('prefix'))]",
    "location": "[parameters('location')]",
    "kind": "web",
    "properties": {
      "Application_Type": "web",
      "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', format('{0}-logs', parameters('prefix')))]",
      "DisableLocalAuth": true
    },
    "dependsOn": [
      "[resourceId('Microsoft.OperationalInsights/workspaces', format('{0}-logs', parameters('prefix')))]"
    ]
  }
]

Step 3: compile, deploy and check

python3 scripts/deps/bicep.py build .local/book-iac/monitoring.bicep \
  --outfile .local/book-iac/monitoring.json

This file has defaults for every parameter. Run the deployment command from the workshop with --name monitoring, --template .local/book-iac/monitoring.json and a distinct outputs filename. Add --parameters when supplying inputs. Select the same deployment in QHQ and wait for Succeeded.

Use the returned connection string with the monitoring chapter's exporter and send a trace. Query AppTraces | take 10 in QHQ. Changing the workspace binding in place is unsupported: plan a new component when moving to another workspace. Retention is also bounded by the local 4,096-row cap.