0
0
Azurecloud~10 mins

Application Insights for apps in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an Application Insights resource in Azure using ARM template syntax.

Azure
{
  "type": "Microsoft.Insights/components",
  "apiVersion": "2015-05-01",
  "name": "myAppInsights",
  "location": "eastus",
  "properties": {
    "Application_Type": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"function"
B"database"
C"mobile"
D"web"
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect application type like "database" or "mobile" for a web app.
Omitting quotes around the application type.
2fill in blank
medium

Complete the Azure CLI command to create an Application Insights resource named 'myAppInsights' in the 'eastus' region.

Azure
az monitor app-insights component create --app myAppInsights --application-type web --location [1] --resource-group myResourceGroup
Drag options to blanks, or click blank then click option'
Acentralus
Beastus
Cwestus
Dnorthcentralus
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting a region different from the intended deployment location.
Misspelling the region name.
3fill in blank
hard

Fix the error in the Application Insights instrumentation key assignment in this Python snippet.

Azure
from applicationinsights import TelemetryClient

instrumentation_key = [1]
tc = TelemetryClient(instrumentation_key)
tc.track_event('TestEvent')
tc.flush()
Drag options to blanks, or click blank then click option'
A"12345-abcde-67890-fghij"
B12345-abcde-67890-fghij
CNone
Dinstrumentation_key
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key without quotes causing a syntax error.
Assigning None or a variable name instead of the actual key string.
4fill in blank
hard

Fill both blanks to configure Application Insights telemetry in a Node.js app using the official SDK.

Azure
const appInsights = require('applicationinsights');
appInsights.[1]('[2]').start();
Drag options to blanks, or click blank then click option'
Asetup
Bstart
C12345678-1234-1234-1234-123456789abc
DdefaultClient
Attempts:
3 left
💡 Hint
Common Mistakes
Using start instead of setup for initialization.
Passing an incorrect property name instead of the instrumentation key.
5fill in blank
hard

Fill all three blanks to create a custom event with properties using Application Insights in C#.

Azure
var telemetryClient = new TelemetryClient();
var properties = new Dictionary<string, string> {{ [1] }};
properties.Add("User", [2]);
telemetryClient.TrackEvent([3], properties);
Drag options to blanks, or click blank then click option'
A"User", "Alice"
B"User"
C"CustomEvent"
Dnew KeyValuePair<string, string>
Attempts:
3 left
💡 Hint
Common Mistakes
Not initializing the dictionary correctly.
Using incorrect event name or property keys.