# microsoft/application-insights-workbooks architecture

> Architecture diagram of the GitHub repository microsoft/application-insights-workbooks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/application-insights-workbooks
- Repository: https://github.com/microsoft/application-insights-workbooks

## Overview

This repository primarily supplies curated Azure Monitor Workbook and Cohort templates to Azure portal galleries. The user-facing path is gallery discovery, template selection, then an interactive workbook that queries Azure data sources, presents visual analysis, and can be customized and saved or managed programmatically. The many template directories represent product-specific analysis experiences rather than application services. A separate scripts/src layer analyzes templates for best-practice findings and usage summaries. The graph follows documented capabilities; template-internal query and rendering links are not shown because their source was not sampled.

Main entry points: [`scripts/src/BestPracticesAnalyzer.ts`](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/BestPracticesAnalyzer.ts) (Best-practice checks), [`scripts/src/AnalyzeTemplates.ts`](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/AnalyzeTemplates.ts) (Template analyzer), [`scripts/src/SummarizeTemplates.ts`](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/SummarizeTemplates.ts) (Template summarizer), [`scripts/src/Interfaces.ts`](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Interfaces.ts) (Analysis result types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Template catalog"]
  node_gallery["Workbook galleries"]
  node_workbook_templates["Workbook templates"]
  node_cohort_templates["Cohort templates"]
end

subgraph group_workbook["Workbook experience"]
  node_portal["Azure portal"]
  node_interactive_report["Interactive reports"]
  node_data_sources[("Azure data sources")]
  node_parameters["User inputs"]
  node_visualizations["Visualizations"]
  node_saved_assets[("Saved workbook assets")]
  node_arm["ARM management"]
end

subgraph group_analysis["Template analysis"]
  node_template_files["Template files"]
  node_analyze_cli["Template analyzer"]
  node_best_practices["Best-practice checks"]
  node_rule_definitions["Rule definitions<br/>[Rules.ts]"]
  node_jsonpath["JSONPath traversal<br/>[JsonPath.ts]"]
  node_summarizer_definitions["Summary definitions<br/>[Summarizers.ts]"]
  node_result_types["Analysis result types<br/>[Interfaces.ts]"]
  node_summary_cli["Template summarizer"]
end

node_user(("Azure Monitor user"))

node_user -->|"browses"| node_gallery
node_gallery -->|"offers templates"| node_workbook_templates
node_gallery -.->|"offers cohorts"| node_cohort_templates
node_user -->|"opens"| node_portal
node_portal -->|"hosts"| node_interactive_report
node_interactive_report -->|"queries metrics logs ARG"| node_data_sources
node_user -->|"provides inputs"| node_parameters
node_interactive_report -->|"presents analysis"| node_visualizations
node_user -->|"customizes and saves"| node_saved_assets
node_user -->|"manages assets"| node_arm
node_template_files -.->|"provides inputs"| node_analyze_cli
node_analyze_cli -->|"analyzes workbooks"| node_best_practices
node_best_practices -->|"evaluates rules"| node_rule_definitions
node_best_practices -->|"queries paths"| node_jsonpath
node_best_practices -->|"counts usage"| node_summarizer_definitions
node_analyze_cli -->|"uses result types"| node_result_types
node_summary_cli -->|"analyzes templates"| node_best_practices
node_summary_cli -->|"merges summaries"| node_result_types

click node_workbook_templates "https://github.com/microsoft/application-insights-workbooks/tree/master/Workbooks"
click node_cohort_templates "https://github.com/microsoft/application-insights-workbooks/tree/master/Cohorts"
click node_template_files "https://github.com/microsoft/application-insights-workbooks/tree/master/Workbooks"
click node_analyze_cli "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/AnalyzeTemplates.ts"
click node_best_practices "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/BestPracticesAnalyzer.ts"
click node_rule_definitions "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Rules.ts"
click node_jsonpath "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/JsonPath.ts"
click node_summarizer_definitions "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Summarizers.ts"
click node_result_types "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Interfaces.ts"
click node_summary_cli "https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/SummarizeTemplates.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gallery,node_workbook_templates,node_cohort_templates,node_user toneBlue
class node_portal,node_interactive_report,node_data_sources,node_parameters,node_visualizations,node_saved_assets,node_arm toneAmber
class node_template_files,node_analyze_cli,node_best_practices,node_rule_definitions,node_jsonpath,node_summarizer_definitions,node_result_types,node_summary_cli toneMint
```

## Components

### Template catalog

- **Workbook galleries**
- [Workbook templates](https://github.com/microsoft/application-insights-workbooks/tree/master/Workbooks): `Workbooks`
- [Cohort templates](https://github.com/microsoft/application-insights-workbooks/tree/master/Cohorts): `Cohorts`

### Workbook experience

- **Azure portal**
- **Interactive reports**
- **Azure data sources**
- **User inputs**
- **Visualizations**
- **Saved workbook assets**
- **ARM management**

### Template analysis

- [Template files](https://github.com/microsoft/application-insights-workbooks/tree/master/Workbooks): `Workbooks`
- [Template analyzer](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/AnalyzeTemplates.ts): `scripts/src/AnalyzeTemplates.ts`
- [Best-practice checks](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/BestPracticesAnalyzer.ts): `scripts/src/BestPracticesAnalyzer.ts`
- [Rule definitions](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Rules.ts): `scripts/src/Rules.ts`
- [JSONPath traversal](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/JsonPath.ts): `scripts/src/JsonPath.ts`
- [Summary definitions](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Summarizers.ts): `scripts/src/Summarizers.ts`
- [Analysis result types](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/Interfaces.ts): `scripts/src/Interfaces.ts`
- [Template summarizer](https://github.com/microsoft/application-insights-workbooks/blob/master/scripts/src/SummarizeTemplates.ts): `scripts/src/SummarizeTemplates.ts`

### Other components

- **Azure Monitor user**

## Connections

- Azure Monitor user → Workbook galleries: browses (evidence: `README.md`)
- Workbook galleries → Workbook templates: offers templates (evidence: `README.md`)
- Workbook galleries → Cohort templates: offers cohorts
- Azure Monitor user → Azure portal: opens (evidence: `README.md`)
- Azure portal → Interactive reports: hosts (evidence: `README.md`)
- Interactive reports → Azure data sources: queries metrics logs ARG (evidence: `README.md`)
- Azure Monitor user → User inputs: provides inputs (evidence: `README.md`)
- Interactive reports → Visualizations: presents analysis (evidence: `README.md`)
- Azure Monitor user → Saved workbook assets: customizes and saves (evidence: `README.md`)
- Azure Monitor user → ARM management: manages assets (evidence: `README.md`)
- Template files → Template analyzer: provides inputs
- Template analyzer → Best-practice checks: analyzes workbooks (evidence: `scripts/src/AnalyzeTemplates.ts`)
- Best-practice checks → Rule definitions: evaluates rules (evidence: `scripts/src/BestPracticesAnalyzer.ts`)
- Best-practice checks → JSONPath traversal: queries paths (evidence: `scripts/src/BestPracticesAnalyzer.ts`)
- Best-practice checks → Summary definitions: counts usage (evidence: `scripts/src/BestPracticesAnalyzer.ts`)
- Template analyzer → Analysis result types: uses result types (evidence: `scripts/src/AnalyzeTemplates.ts`)
- Template summarizer → Best-practice checks: analyzes templates (evidence: `scripts/src/SummarizeTemplates.ts`)
- Template summarizer → Analysis result types: merges summaries (evidence: `scripts/src/SummarizeTemplates.ts`)
