|
| 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 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +[](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 | +[](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 | +[](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` |
0 commit comments