Skip to content

Commit ca33cf3

Browse files
author
Amy Richardson
committed
Add CloudHealth health model quickstart samples
Three quickstart templates for Microsoft.CloudHealth/healthModels: - healthmodel-basic: minimal ARG discovery with recommended signals - healthmodel-with-custom-signals: ARG discovery + custom signal definitions - healthmodel-appinsights-topology: App Insights topology-based discovery All templates target the 2026-01-01-preview API version.
1 parent 1c73263 commit ca33cf3

12 files changed

Lines changed: 665 additions & 0 deletions

File tree

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
description: This template creates a Microsoft.CloudHealth health model that uses Application Insights topology-based discovery to automatically find application components and their dependencies.
3+
page_type: sample
4+
products:
5+
- azure
6+
- azure-resource-manager
7+
urlFragment: healthmodel-appinsights-topology
8+
languages:
9+
- bicep
10+
- json
11+
---
12+
# Create an Azure Health Model with Application Insights topology discovery
13+
14+
![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/PublicLastTestDate.svg)
15+
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/PublicDeployment.svg)
16+
17+
![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/FairfaxLastTestDate.svg)
18+
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/FairfaxDeployment.svg)
19+
20+
![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/BestPracticeResult.svg)
21+
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/CredScanResult.svg)
22+
23+
![Bicep Version](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-appinsights-topology/BicepVersion.svg)
24+
25+
[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cloudhealth%2Fhealthmodel-appinsights-topology%2Fazuredeploy.json)
26+
[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cloudhealth%2Fhealthmodel-appinsights-topology%2Fazuredeploy.json)
27+
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cloudhealth%2Fhealthmodel-appinsights-topology%2Fazuredeploy.json)
28+
29+
This template deploys an **Azure Health Model** (`Microsoft.CloudHealth/healthModels`) that uses **Application Insights topology** to discover application components and their dependencies.
30+
31+
## Overview
32+
33+
Instead of writing an Azure Resource Graph query, this quickstart uses the **Application Insights application map** as the discovery source. The platform reads the topology from your Application Insights resource and creates health model entities for each component and dependency it finds.
34+
35+
The template creates three resources:
36+
37+
1. **Health model** — the top-level resource with a system-assigned managed identity.
38+
2. **Authentication setting** — configures the managed identity used by the discovery rule to access the Application Insights resource.
39+
3. **Discovery rule** — uses the `ApplicationInsightsTopology` specification kind to discover components. Both `addRecommendedSignals` and `discoverRelationships` are enabled.
40+
41+
### When to use this template
42+
43+
- You have an Application Insights resource instrumented with your application.
44+
- You want the health model to automatically reflect your application's topology (front-end, back-end, databases, external dependencies).
45+
- You prefer topology-driven discovery over explicit resource queries.
46+
47+
> **Looking for resource-based discovery?** See the [healthmodel-basic](../healthmodel-basic/) quickstart for ARG-based discovery, or [healthmodel-with-custom-signals](../healthmodel-with-custom-signals/) to add custom signal definitions.
48+
49+
## Prerequisites
50+
51+
- An Azure subscription.
52+
- An existing Application Insights resource (`Microsoft.Insights/components`) with application telemetry flowing in.
53+
- The health model's managed identity needs **Reader** access to the Application Insights resource.
54+
55+
## Deployment
56+
57+
```bash
58+
az deployment group create \
59+
--resource-group <resource-group-name> \
60+
--template-file main.bicep \
61+
--parameters healthModelName='<health-model-name>' \
62+
applicationInsightsResourceId='<app-insights-resource-id>'
63+
```
64+
65+
```powershell
66+
New-AzResourceGroupDeployment `
67+
-ResourceGroupName <resource-group-name> `
68+
-TemplateFile main.bicep `
69+
-healthModelName '<health-model-name>' `
70+
-applicationInsightsResourceId '<app-insights-resource-id>'
71+
```
72+
73+
## Parameters
74+
75+
| Parameter | Type | Default | Description |
76+
|---|---|---|---|
77+
| `healthModelName` | string | *(required)* | Name of the health model resource. |
78+
| `location` | string | Resource group location | Location for all resources. |
79+
| `applicationInsightsResourceId` | string | *(required)* | Full resource ID of the Application Insights component (e.g. `/subscriptions/.../providers/Microsoft.Insights/components/my-app`). |
80+
81+
## Outputs
82+
83+
| Output | Type | Description |
84+
|---|---|---|
85+
| `healthModelId` | string | Resource ID of the deployed health model. |
86+
| `healthModelName` | string | Name of the deployed health model. |
87+
| `healthModelPrincipalId` | string | Principal ID of the system-assigned managed identity. |
88+
| `discoveryRuleName` | string | Name of the discovery rule child resource. |
89+
90+
## Resources
91+
92+
- [Azure Cloud Health overview](https://learn.microsoft.com/azure/cloud-health/)
93+
- [Health modeling in Azure](https://learn.microsoft.com/azure/cloud-health/health-modeling)
94+
- [Application Insights application map](https://learn.microsoft.com/azure/azure-monitor/app/app-map)
95+
- [Template reference: Microsoft.CloudHealth/healthModels](https://learn.microsoft.com/azure/templates/microsoft.cloudhealth/healthmodels)
96+
97+
`Tags: Health Model, Cloud Health, Application Insights, Topology, Discovery Rules, Recommended Signals, Monitoring, Microsoft.CloudHealth/healthModels, Microsoft.CloudHealth/healthModels/authenticationSettings, Microsoft.CloudHealth/healthModels/discoveryRules`
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"healthModelName": {
6+
"value": "GEN-UNIQUE"
7+
},
8+
"applicationInsightsResourceId": {
9+
"value": "GEN-UNIQUE"
10+
}
11+
}
12+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
@description('Name of the health model resource.')
2+
param healthModelName string
3+
4+
@description('Location for all resources.')
5+
param location string = resourceGroup().location
6+
7+
@description('Resource ID of the Application Insights component to use for topology-based discovery.')
8+
param applicationInsightsResourceId string
9+
10+
// --------------------------------------------------------------------------
11+
// Health Model
12+
// ---------------------------------------------------------------------------
13+
14+
resource healthModel 'Microsoft.CloudHealth/healthModels@2026-01-01-preview' = {
15+
name: healthModelName
16+
location: location
17+
identity: {
18+
type: 'SystemAssigned'
19+
}
20+
properties: {}
21+
}
22+
23+
// ---------------------------------------------------------------------------
24+
// Authentication Setting
25+
// ---------------------------------------------------------------------------
26+
27+
resource authSetting 'Microsoft.CloudHealth/healthModels/authenticationSettings@2026-01-01-preview' = {
28+
parent: healthModel
29+
name: 'default-auth'
30+
properties: {
31+
displayName: 'System-assigned identity'
32+
authenticationKind: 'ManagedIdentity'
33+
managedIdentityName: 'SystemAssigned'
34+
}
35+
}
36+
37+
// ---------------------------------------------------------------------------
38+
// Discovery Rule — Application Insights Topology
39+
// ---------------------------------------------------------------------------
40+
// Uses the application map from an Application Insights resource to discover
41+
// the components of your application and their dependencies. Recommended
42+
// signals are enabled so each discovered entity automatically receives
43+
// curated health signals. Relationship discovery is enabled so the platform
44+
// infers topology links between components.
45+
// ---------------------------------------------------------------------------
46+
47+
resource discoveryRule 'Microsoft.CloudHealth/healthModels/discoveryRules@2026-01-01-preview' = {
48+
parent: healthModel
49+
name: 'discover-app-topology'
50+
properties: {
51+
displayName: 'Discover Application Insights topology'
52+
authenticationSetting: authSetting.name
53+
discoverRelationships: 'Enabled'
54+
addRecommendedSignals: 'Enabled'
55+
specification: {
56+
kind: 'ApplicationInsightsTopology'
57+
applicationInsightsResourceId: applicationInsightsResourceId
58+
}
59+
}
60+
}
61+
62+
// ---------------------------------------------------------------------------
63+
// Outputs
64+
// ---------------------------------------------------------------------------
65+
66+
output healthModelId string = healthModel.id
67+
output healthModelName string = healthModel.name
68+
output healthModelPrincipalId string = healthModel.identity.principalId
69+
output discoveryRuleName string = discoveryRule.name
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
3+
"type": "QuickStart",
4+
"itemDisplayName": "Health Model with App Insights topology discovery",
5+
"description": "This template creates a Microsoft.CloudHealth health model that uses Application Insights topology-based discovery to automatically find application components and their dependencies, with recommended signals and relationship discovery enabled.",
6+
"summary": "This template deploys a health model that discovers application components from an Application Insights resource and automatically adds recommended health signals.",
7+
"githubUsername": "amrichardson",
8+
"dateUpdated": "2026-04-28",
9+
"testResult": {
10+
"deployments": {
11+
"templateFileName": "main.bicep",
12+
"correlationId": "",
13+
"deploymentName": ""
14+
}
15+
}
16+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
description: This template creates a minimal Microsoft.CloudHealth health model with a discovery rule and recommended signals — the fastest way to get started with Azure health modeling.
3+
page_type: sample
4+
products:
5+
- azure
6+
- azure-resource-manager
7+
urlFragment: healthmodel-basic
8+
languages:
9+
- bicep
10+
- json
11+
---
12+
# Create a basic Azure Health Model with discovery and recommended signals
13+
14+
![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/PublicLastTestDate.svg)
15+
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/PublicDeployment.svg)
16+
17+
![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/FairfaxLastTestDate.svg)
18+
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/FairfaxDeployment.svg)
19+
20+
![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/BestPracticeResult.svg)
21+
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/CredScanResult.svg)
22+
23+
![Bicep Version](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.cloudhealth/healthmodel-basic/BicepVersion.svg)
24+
25+
[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cloudhealth%2Fhealthmodel-basic%2Fazuredeploy.json)
26+
[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cloudhealth%2Fhealthmodel-basic%2Fazuredeploy.json)
27+
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.cloudhealth%2Fhealthmodel-basic%2Fazuredeploy.json)
28+
29+
This template deploys a minimal **Azure Health Model** (`Microsoft.CloudHealth/healthModels`) with a single **discovery rule** and **recommended signals** enabled. It is the fastest way to get started with health modeling in Azure.
30+
31+
## Overview
32+
33+
The template creates three resources:
34+
35+
1. **Health model** — the top-level resource with a system-assigned managed identity.
36+
2. **Authentication setting** — configures the managed identity used by the discovery rule to query Azure Resource Graph.
37+
3. **Discovery rule** — uses an Azure Resource Graph (ARG) query to find resources. Both `addRecommendedSignals` and `discoverRelationships` are enabled, so the platform automatically attaches curated health signals and infers topology between discovered entities.
38+
39+
By default the discovery rule finds all virtual machines in the current resource group. Customise the `resourceGraphQuery` parameter to target any set of Azure resources.
40+
41+
> **Looking for more control?** See the [healthmodel-with-custom-signals](../healthmodel-with-custom-signals/) quickstart to layer custom signal definitions on top of recommended signals.
42+
43+
## Prerequisites
44+
45+
- An Azure subscription.
46+
- A resource group containing (or that will contain) the resources to monitor.
47+
48+
## Deployment
49+
50+
```bash
51+
az deployment group create \
52+
--resource-group <resource-group-name> \
53+
--template-file main.bicep \
54+
--parameters healthModelName='<health-model-name>'
55+
```
56+
57+
```powershell
58+
New-AzResourceGroupDeployment `
59+
-ResourceGroupName <resource-group-name> `
60+
-TemplateFile main.bicep `
61+
-healthModelName '<health-model-name>'
62+
```
63+
64+
## Parameters
65+
66+
| Parameter | Type | Default | Description |
67+
|---|---|---|---|
68+
| `healthModelName` | string | *(required)* | Name of the health model resource. |
69+
| `location` | string | Resource group location | Location for all resources. |
70+
| `resourceGraphQuery` | string | VMs in current resource group | ARG query returning a column named `id` with Azure resource IDs. |
71+
72+
## Outputs
73+
74+
| Output | Type | Description |
75+
|---|---|---|
76+
| `healthModelId` | string | Resource ID of the deployed health model. |
77+
| `healthModelName` | string | Name of the deployed health model. |
78+
| `healthModelPrincipalId` | string | Principal ID of the system-assigned managed identity. |
79+
| `discoveryRuleName` | string | Name of the discovery rule child resource. |
80+
81+
## Resources
82+
83+
- [Azure Cloud Health overview](https://learn.microsoft.com/azure/cloud-health/)
84+
- [Health modeling in Azure](https://learn.microsoft.com/azure/cloud-health/health-modeling)
85+
- [Template reference: Microsoft.CloudHealth/healthModels](https://learn.microsoft.com/azure/templates/microsoft.cloudhealth/healthmodels)
86+
87+
`Tags: Health Model, Cloud Health, Discovery Rules, Recommended Signals, Monitoring, Microsoft.CloudHealth/healthModels, Microsoft.CloudHealth/healthModels/authenticationSettings, Microsoft.CloudHealth/healthModels/discoveryRules`
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"healthModelName": {
6+
"value": "GEN-UNIQUE"
7+
}
8+
}
9+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@description('Name of the health model resource.')
2+
param healthModelName string
3+
4+
@description('Location for all resources.')
5+
param location string = resourceGroup().location
6+
7+
@description('Azure Resource Graph query that discovers the resources to monitor. The query must return a column named "id" containing resource IDs.')
8+
param resourceGraphQuery string = 'resources | where type =~ "microsoft.compute/virtualMachines" | where resourceGroup =~ resourceGroup().name'
9+
10+
// --------------------------------------------------------------------------
11+
// Health Model
12+
// ---------------------------------------------------------------------------
13+
// The health model is the top-level resource. A system-assigned managed
14+
// identity is required so the discovery rule can query Azure Resource Graph.
15+
// ---------------------------------------------------------------------------
16+
17+
resource healthModel 'Microsoft.CloudHealth/healthModels@2026-01-01-preview' = {
18+
name: healthModelName
19+
location: location
20+
identity: {
21+
type: 'SystemAssigned'
22+
}
23+
properties: {}
24+
}
25+
26+
// ---------------------------------------------------------------------------
27+
// Authentication Setting
28+
// ---------------------------------------------------------------------------
29+
// Discovery rules reference an authentication setting by name. This setting
30+
// uses the health model's system-assigned managed identity.
31+
// ---------------------------------------------------------------------------
32+
33+
resource authSetting 'Microsoft.CloudHealth/healthModels/authenticationSettings@2026-01-01-preview' = {
34+
parent: healthModel
35+
name: 'default-auth'
36+
properties: {
37+
displayName: 'System-assigned identity'
38+
authenticationKind: 'ManagedIdentity'
39+
managedIdentityName: 'SystemAssigned'
40+
}
41+
}
42+
43+
// ---------------------------------------------------------------------------
44+
// Discovery Rule
45+
// ---------------------------------------------------------------------------
46+
// Discovers resources via an Azure Resource Graph query. Recommended signals
47+
// and relationship discovery are both enabled, so the platform automatically
48+
// attaches curated health signals and infers topology.
49+
// ---------------------------------------------------------------------------
50+
51+
resource discoveryRule 'Microsoft.CloudHealth/healthModels/discoveryRules@2026-01-01-preview' = {
52+
parent: healthModel
53+
name: 'discover-target-resources'
54+
properties: {
55+
displayName: 'Discover target resources'
56+
authenticationSetting: authSetting.name
57+
discoverRelationships: 'Enabled'
58+
addRecommendedSignals: 'Enabled'
59+
specification: {
60+
kind: 'ResourceGraphQuery'
61+
resourceGraphQuery: resourceGraphQuery
62+
}
63+
}
64+
}
65+
66+
// ---------------------------------------------------------------------------
67+
// Outputs
68+
// ---------------------------------------------------------------------------
69+
70+
output healthModelId string = healthModel.id
71+
output healthModelName string = healthModel.name
72+
output healthModelPrincipalId string = healthModel.identity.principalId
73+
output discoveryRuleName string = discoveryRule.name

0 commit comments

Comments
 (0)