Skip to content

Commit 8de317b

Browse files
authored
Merge pull request #114655 from mrbullwinkle/mrb_05_08_2020_APM_2_1
Application Insights workspace-enabled resources
2 parents 45aa63a + 8f8b043 commit 8de317b

15 files changed

+783
-47
lines changed

articles/azure-monitor/app/apm-tables.md

Lines changed: 466 additions & 0 deletions
Large diffs are not rendered by default.

articles/azure-monitor/app/create-new-resource.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ Sign in to the [Azure portal](https://portal.azure.com), and create an Applicati
2222

2323
| Settings | Value | Description |
2424
| ------------- |:-------------|:-----|
25-
| **Name** | Unique value | Name that identifies the app you are monitoring. |
26-
| **Resource Group** | myResourceGroup | Name for the new or existing resource group to host App Insights data. |
27-
| **Location** | East US | Choose a location near you, or near where your app is hosted. |
25+
| **Name** | `Unique value` | Name that identifies the app you are monitoring. |
26+
| **Resource Group** | `myResourceGroup` | Name for the new or existing resource group to host App Insights data. |
27+
| **Region** | `East US` | Choose a location near you, or near where your app is hosted. |
28+
| **Resource Mode** | `Classic` or `Workspace-based` | Workspace-based resources are currently in public preview and allow you to send your Application Insights telemetry to a common Log Analytics workspace. For more information, see the [article on workspace-based resources](create-workspace-resource.md).
2829

2930
> [!NOTE]
3031
> While you can use the same resource name across different resource groups, it can be beneficial to use a globally unique name. This can be useful if you plan to [perform cross resource queries](https://docs.microsoft.com/azure/azure-monitor/log-query/cross-workspace-query#identifying-an-application) as it simplifies the required syntax.
@@ -92,13 +93,13 @@ For the full PowerShell documentation for this cmdlet, and to learn how to retri
9293

9394
### Azure CLI (preview)
9495

95-
To access the preview Application Insights Azure CLI commands you first need to run:
96+
To access the preview Application Insights Azure CLI commands, you first need to run:
9697

9798
```azurecli
9899
az extension add -n application-insights
99100
```
100101

101-
If you don't run the `az extension add` command you will see an error message that states: `az : ERROR: az monitor: 'app-insights' is not in the 'az monitor' command group. See 'az monitor --help'.`
102+
If you don't run the `az extension add` command, you will see an error message that states: `az : ERROR: az monitor: 'app-insights' is not in the 'az monitor' command group. See 'az monitor --help'.`
102103

103104
Now you can run the following to create your Application Insights resource:
104105

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
title: Create a new Azure Monitor Application Insights workspace-based resource | Microsoft Docs
3+
description: Learn about the steps required to enable the new Azure Monitor Application Insights workspace-based resources.
4+
author: mrbullwinkle
5+
ms.author: mbullwin
6+
ms.topic: conceptual
7+
ms.date: 12/02/2019
8+
9+
---
10+
11+
# Workspace-based Application Insights resources (preview)
12+
13+
Workspace-based resources support full integration between Application Insights and Log Analytics. You can now choose to send your Application Insights telemetry to a common Log Analytics workspace, which allows you full access to all the features of Log Analytics while keeping application, infrastructure, and platform logs in a single consolidated location.
14+
15+
This also allows for common Role-Based Access Control (RBAC) across your resources, and eliminates the need for cross-app/workspace queries.
16+
17+
> [!NOTE]
18+
> Data ingestion and retention for workspace-based Application Insights resources are billed through the Log Analytics workspace where the data is located. [Learn more]( https://docs.microsoft.com/azure/azure-monitor/app/pricing#workspace-based-application-insights) about billing for workspace-based Application Insights resources.
19+
20+
To test out the new experience, sign in to the [Azure portal](https://portal.azure.com), and create an Application Insights resource:
21+
22+
![Workspace-based Application Insights resource](./media/create-workspace-resource/create-workspace-based.png)
23+
24+
If you don't already have an existing Log Analytics Workspace, [consult the Log Analytics workspace creation documentation](https://docs.microsoft.com/azure/azure-monitor/learn/quick-create-workspace).
25+
26+
For the public preview **workspace-based resources are currently limited to West US 2, East US, and South Central US.**
27+
28+
Once your resource is created, you will see the corresponding workspace info in the **Overview** pane:
29+
30+
![Workspace Name](./media/create-workspace-resource/workspace-name.png)
31+
32+
Clicking the blue link text will take you to the associated Log Analytics workspace where you can take advantage of the new unified workspace query environment.
33+
34+
> [!NOTE]
35+
> We still provide full backwards compatibility for your Application Insights classic resource queries, workbooks, and log-based alerts within the Application Insights experience. To query/view against the [new workspace-based table structure/schema](apm-tables.md) you must first navigate to your Log Analytics workspace. During the preview, selecting **Logs** from within the Application Insights panes will give you access to the classic Application Insights query experience.
36+
37+
## Copy the connection string
38+
39+
The [connection string]() identifies the resource that you want to associate your telemetry data with. It also allows you to modify the endpoints your resource will use as a destination for your telemetry. You will need to copy the connection string and add it to your application's code or to an environment variable.
40+
41+
![Click and copy the instrumentation key](./media/create-new-resource/instrumentation-key.png)
42+
43+
## Monitoring configuration
44+
45+
Once a workspace-based Application Insights resource has been created, configuring monitoring is relatively straightforward.
46+
47+
### Code-based application monitoring
48+
49+
For code-based application monitoring, you would just install the appropriate Application Insights SDK and point it to the instrumentation key or connection string to your newly created resource.
50+
51+
For detailed documentation on setting up an Application Insights SDK for code-based monitoring consult the language/framework specific documentation:
52+
53+
- [ASP.NET](https://docs.microsoft.com/azure/azure-monitor/app/asp-net)
54+
- [ASP.NET Core ](https://docs.microsoft.com/azure/azure-monitor/app/asp-net-core)
55+
- [Background tasks & modern console applications (.NET/.NET Core)](https://docs.microsoft.com/azure/azure-monitor/app/worker-service)
56+
- [Classic console applications (.NET)](https://docs.microsoft.com/azure/azure-monitor/app/console)
57+
- [Java ](https://docs.microsoft.com/azure/azure-monitor/app/java-get-started?tabs=maven)
58+
- [JavaScript](https://docs.microsoft.com/azure/azure-monitor/app/javascript)
59+
- [Node.js](https://docs.microsoft.com/azure/azure-monitor/app/nodejs)
60+
- [Python](https://docs.microsoft.com/azure/azure-monitor/app/opencensus-python)
61+
62+
### Codeless monitoring and Visual Studio resource creation
63+
64+
For codeless monitoring of services like Azure Functions and Azure App Services, you will also need to first create your workspace-based Application Insights resource and then point to that resource during the monitoring configuration phase.
65+
66+
While these services offer the option to create a new Application Insights resource within their own resource creation process, resources created via these UI options are currently restricted to the classic Application Insights experience.
67+
68+
The same applies to the Application Insights resource creation experience in Visual Studio for ASP.NET and ASP.NET Core. You must select an existing workspace-based resource from with the Visual Studio monitoring enablement UI. Selecting create new resource from within Visual Studio will limit you to creating a classic Application Insights resource.
69+
70+
## Creating a resource automatically
71+
72+
### Azure CLI
73+
74+
To access the preview Application Insights Azure CLI commands, you first need to run:
75+
76+
```azurecli
77+
az extension add -n application-insights
78+
```
79+
80+
If you don't run the `az extension add` command, you will see an error message that states: `az : ERROR: az monitor: 'app-insights' is not in the 'az monitor' command group. See 'az monitor --help'.`
81+
82+
Now you can run the following to create your Application Insights resource:
83+
84+
```azurecli
85+
az monitor app-insights component create --app
86+
--location
87+
--resource-group
88+
[--application-type]
89+
[--ingestion-access {Disabled, Enabled}]
90+
[--kind]
91+
[--only-show-errors]
92+
[--query-access {Disabled, Enabled}]
93+
[--tags]
94+
[--workspace]
95+
```
96+
97+
#### Example
98+
99+
```azurecli
100+
az monitor app-insights component create --app demoApp --location eastus --kind web -g my_resource_group --workspace "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test1234/providers/microsoft.operationalinsights/workspaces/test1234555"
101+
```
102+
103+
For the full Azure CLI documentation for this command, consult the [Azure CLI documentation](https://docs.microsoft.com/cli/azure/ext/application-insights/monitor/app-insights/component?view=azure-cli-latest#ext-application-insights-az-monitor-app-insights-component-create).
104+
105+
### Azure PowerShell
106+
107+
The `New-AzApplicationInsights` PowerShell command does not currently support creating a workspace-based Application Insights resource. To create a workspace-based resource with PowerShell, you can use the Azure Resource Manager templates below and deploy with PowerShell.
108+
109+
### Azure Resource Manager templates
110+
111+
#### Template file
112+
113+
```json
114+
{
115+
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
116+
"contentVersion": "1.0.0.0",
117+
"parameters": {
118+
"name": {
119+
"type": "string"
120+
},
121+
"type": {
122+
"type": "string"
123+
},
124+
"regionId": {
125+
"type": "string"
126+
},
127+
"tagsArray": {
128+
"type": "object"
129+
},
130+
"requestSource": {
131+
"type": "string"
132+
},
133+
"workspaceResourceId": {
134+
"type": "string"
135+
}
136+
},
137+
"resources": [
138+
{
139+
"name": "[parameters('name')]",
140+
"type": "microsoft.insights/components",
141+
"location": "[parameters('regionId')]",
142+
"tags": "[parameters('tagsArray')]",
143+
"apiVersion": "2020-02-02-preview",
144+
"properties": {
145+
"ApplicationId": "[parameters('name')]",
146+
"Application_Type": "[parameters('type')]",
147+
"Flow_Type": "Redfield",
148+
"Request_Source": "[parameters('requestSource')]",
149+
"WorkspaceResourceId": "[parameters('workspaceResourceId')]"
150+
}
151+
}
152+
]
153+
}
154+
```
155+
156+
#### Parameters file
157+
158+
```json
159+
{
160+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
161+
"contentVersion": "1.0.0.0",
162+
"parameters": {
163+
"type": {
164+
"value": "web"
165+
},
166+
"name": {
167+
"value": "customresourcename"
168+
},
169+
"regionId": {
170+
"value": "eastus"
171+
},
172+
"tagsArray": {
173+
"value": {}
174+
},
175+
"requestSource": {
176+
"value": "Custom"
177+
},
178+
"workspaceResourceId": {
179+
"value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my_resource_group/providers/microsoft.operationalinsights/workspaces/myworkspacename"
180+
}
181+
}
182+
}
183+
184+
```
185+
186+
## Modifying the associated workspace
187+
188+
Once a workspace-based Application Insights resource has been created, you can modify the associated Log Analytics Workspace.
189+
190+
From within the Application Insights resource pane, select **Properties** > **Change Workspace** > **Log Analytics Workspaces**
191+
192+
## Next steps
193+
194+
* [Explore metrics](../../azure-monitor/platform/metrics-charts.md)
195+
* [Write Analytics queries](../../azure-monitor/app/analytics.md)
196+
197+
[api]: ../../azure-monitor/app/api-custom-events-metrics.md
198+
[diagnostic]: ../../azure-monitor/app/diagnostic-search.md
199+
[metrics]: ../../azure-monitor/platform/metrics-charts.md
200+
[start]: ../../azure-monitor/app/app-insights-overview.md
23.3 KB
Loading
23.4 KB
Loading
106 KB
Loading
78 KB
Loading

articles/azure-monitor/app/pricing.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ The pricing for [Azure Application Insights][start] is a **Pay-As-You-Go** model
2626

2727
The Application Insights option to [Enable alerting on custom metric dimensions](https://docs.microsoft.com/azure/azure-monitor/app/pre-aggregated-metrics-log-metrics#custom-metrics-dimensions-and-pre-aggregation) can also generate in additional costs because this can result in the creation of additional pre-aggregation metrics. [Learn more](https://docs.microsoft.com/azure/azure-monitor/app/pre-aggregated-metrics-log-metrics) about log-based and pre-aggregated metrics in Application Insights and about [pricing](https://azure.microsoft.com/pricing/details/monitor/) for Azure Monitor custom metrics.
2828

29+
### Workspace-based Application Insights
30+
31+
For Application Insights resources which send their data to a Log Analytics workspace, called [workspace-based Application Insights resources](create-workspace-resource.md), the billing for data ingestion and retention is done by the workspace where the Application Insights data is located. This enables customers to leverage all options of the Log Analytics [pricing model](https://docs.microsoft.com/azure/azure-monitor/platform/manage-cost-storage#pricing-model) that includes Capacity Reservations in addition to Pay-As-You-Go. Log Analytics also has more options for data retention, including [retention by data type](https://docs.microsoft.com/azure/azure-monitor/platform/manage-cost-storage#retention-by-data-type). Application Insights data types in the workspace receive 90 days of retention without charges. Usage of web tests and enabling alerting on custom metric dimensions is still reported through Application Insights. Learn how to track data ingestion and retention costs in Log Analytics using the [Usage and estimated costs](https://docs.microsoft.com/azure/azure-monitor/platform/manage-cost-storage#understand-your-usage-and-estimate-costs), [Azure Cost Management + Billing](https://docs.microsoft.com/azure/azure-monitor/platform/manage-cost-storage#viewing-log-analytics-usage-on-your-azure-bill) and [Log Analytics queries](#data-volume-for-workspace-based-application-insights-resources).
32+
2933
## Estimating the costs to manage your application
3034

3135
If you're not yet using Application Insights, you can use the [Azure Monitor pricing calculator](https://azure.microsoft.com/pricing/calculator/?service=monitor) to estimate the cost of using Application Insights. Start by entering "Azure Monitor" in the Search box, and clicking on the resulting Azure Monitor tile. Scroll down the page to Azure Monitor, and select Application Insights from the Type dropdown. Here you can enter the number of GB of data you expect to collect per month, so the question is how much data will Application Insights collect monitoring your application.
@@ -71,7 +75,7 @@ To learn more about your data volumes, selecting **Metrics** for your Applicatio
7175

7276
### Queries to understand data volume details
7377

74-
There are two approaches to investigating data volumes for Application Insights. The first uses aggregated information in the `systemEvents` table, and the second uses the `_BilledSize` property, which is available on each ingested event.
78+
There are two approaches to investigating data volumes for Application Insights. The first uses aggregated information in the `systemEvents` table, and the second uses the `_BilledSize` property, which is available on each ingested event. `systemEvents` will not have data size information for [workspace-based-application-insights](#data-volume-for-workspace-based-application-insights-resources).
7579

7680
#### Using aggregated data volume information
7781

@@ -123,6 +127,47 @@ dependencies
123127
| render barchart
124128
```
125129

130+
#### Data volume for workspace-based Application Insights resources
131+
132+
To look at the data volume trends for all of the [workspace-based Application Insights resources](create-workspace-resource.md) in a workspace for the last week, go to the Log Analytics workspace and run the query:
133+
134+
```kusto
135+
union (AppAvailabilityResults),
136+
(AppBrowserTimings),
137+
(AppDependencies),
138+
(AppExceptions),
139+
(AppEvents),
140+
(AppMetrics),
141+
(AppPageViews),
142+
(AppPerformanceCounters),
143+
(AppRequests),
144+
(AppSystemEvents),
145+
(AppTraces)
146+
| where TimeGenerated >= startofday(ago(7d) and TimeGenerated < startofday(now())
147+
| summarize sum(_BilledSize) by _ResourceId, bin(TimeGenerated, 1d)
148+
| render areachart
149+
```
150+
151+
To query the data volume trends by type for a specific workspace-based Application Insights resource, in the Log Analytics workspace use:
152+
153+
```kusto
154+
union (AppAvailabilityResults),
155+
(AppBrowserTimings),
156+
(AppDependencies),
157+
(AppExceptions),
158+
(AppEvents),
159+
(AppMetrics),
160+
(AppPageViews),
161+
(AppPerformanceCounters),
162+
(AppRequests),
163+
(AppSystemEvents),
164+
(AppTraces)
165+
| where TimeGenerated >= startofday(ago(7d) and TimeGenerated < startofday(now())
166+
| where _ResourceId contains "<myAppInsightsResourceName>"
167+
| summarize sum(_BilledSize) by Type, bin(TimeGenerated, 1d)
168+
| render areachart
169+
```
170+
126171
## Viewing Application Insights usage on your Azure bill
127172

128173
Azure provides a great deal of useful functionality in the [Azure Cost Management + Billing](https://docs.microsoft.com/azure/cost-management/quick-acm-cost-analysis?toc=/azure/billing/TOC.json) hub. For instance, the "Cost analysis" functionality enables you to view your spends for Azure resources. Adding a filter by resource type (to microsoft.insights/components for Application Insights) will allow you to track your spending. Then for "Group by" select "Meter category" or "Meter". For Application Insights resources on the current pricing plans, most usage will show up as Log Analytics for the Meter category since there is a single logs backend for all Azure Monitor components.
@@ -174,7 +219,7 @@ To [change the daily cap via Azure Resource Manager](../../azure-monitor/app/pow
174219

175220
### Create alerts for the Daily Cap
176221

177-
The Application Insights Daily Cap creates an event in the Azure activity log when the ingested data volumes hits the warning level or the daily cap level. You can [create an alert based on these activity log events](https://docs.microsoft.com/azure/azure-monitor/platform/alerts-activity-log#create-with-the-azure-portal). The signal names for these events are:
222+
The Application Insights Daily Cap creates an event in the Azure activity log when the ingested data volumes reaches the warning level or the daily cap level. You can [create an alert based on these activity log events](https://docs.microsoft.com/azure/azure-monitor/platform/alerts-activity-log#create-with-the-azure-portal). The signal names for these events are:
178223

179224
* Application Insights component daily cap warning threshold reached
180225

0 commit comments

Comments
 (0)