Components - Create Or Update

Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}?api-version=2015-05-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

resourceName
path True

string

The name of the Application Insights component resource.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
kind True

string

The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.

location True

string

Resource location

properties.Application_Type True

ApplicationType

Type of application being monitored.

properties.DisableIpMasking

boolean

Disable IP masking.

properties.Flow_Type

FlowType

Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.

properties.HockeyAppId

string

The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.

properties.ImmediatePurgeDataOn30Days

boolean

Purge data immediately after 30 days.

properties.IngestionMode

IngestionMode

Indicates the flow of the ingestion.

properties.Request_Source

RequestSource

Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.

properties.RetentionInDays

integer

Retention period in days.

properties.SamplingPercentage

number

Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.

tags

object

Resource tags

Responses

Name Type Description
200 OK

ApplicationInsightsComponent

Successful request when creating or updating an Application Insights component. The updated component is returned.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ComponentCreate
ComponentUpdate

ComponentCreate

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component?api-version=2015-05-01

{
  "location": "South Central US",
  "kind": "web",
  "properties": {
    "Application_Type": "web",
    "Flow_Type": "Bluefield",
    "Request_Source": "rest"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component",
  "name": "my-component",
  "type": "Microsoft.Insights/components",
  "location": "South Central US",
  "tags": "",
  "kind": "web",
  "properties": {
    "ApplicationId": "my-component",
    "AppId": "887f4bfd-b5fd-40d7-9fc3-123456789abc",
    "Application_Type": "web",
    "Flow_Type": "Bluefield",
    "Request_Source": "rest",
    "InstrumentationKey": "bc095013-3cf2-45ac-ab47-123456789abc",
    "CreationDate": "2017-01-24T01:05:38.5934061+00:00",
    "TenantId": "f438d567-7177-4fe1-a5e3-123456789abc",
    "HockeyAppId": "",
    "HockeyAppToken": "",
    "provisioningState": "Succeeded",
    "SamplingPercentage": 100,
    "RetentionInDays": 90,
    "ConnectionString": "InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc",
    "DisableIpMasking": false,
    "ImmediatePurgeDataOn30Days": false,
    "IngestionMode": "ApplicationInsights"
  }
}

ComponentUpdate

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component?api-version=2015-05-01

{
  "location": "South Central US",
  "kind": "web",
  "tags": {
    "ApplicationGatewayType": "Internal-Only",
    "BillingEntity": "Self"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component",
  "name": "my-component",
  "type": "Microsoft.Insights/components",
  "location": "South Central US",
  "tags": {
    "ApplicationGatewayType": "Internal-Only",
    "BillingEntity": "Self"
  },
  "kind": "web",
  "properties": {
    "ApplicationId": "my-component",
    "AppId": "887f4bfd-b5fd-40d7-9fc3-123456789abc",
    "Application_Type": "web",
    "Flow_Type": "Bluefield",
    "Request_Source": "rest",
    "InstrumentationKey": "bc095013-3cf2-45ac-ab47-123456789abc",
    "CreationDate": "2017-01-24T01:05:38.5934061+00:00",
    "TenantId": "f438d567-7177-4fe1-a5e3-123456789abc",
    "HockeyAppId": "",
    "HockeyAppToken": "",
    "provisioningState": "Succeeded",
    "SamplingPercentage": 100,
    "RetentionInDays": 90,
    "ConnectionString": "InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc",
    "DisableIpMasking": false,
    "ImmediatePurgeDataOn30Days": false,
    "IngestionMode": "ApplicationInsights"
  }
}

Definitions

Name Description
ApplicationInsightsComponent

An Application Insights component definition.

ApplicationType

Type of application being monitored.

FlowType

Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.

IngestionMode

Indicates the flow of the ingestion.

PrivateLinkScopedResource

The private link scope resource reference.

RequestSource

Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.

ApplicationInsightsComponent

An Application Insights component definition.

Name Type Default Value Description
id

string

Azure resource Id

kind

string

The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.

location

string

Resource location

name

string

Azure resource name

properties.AppId

string

Application Insights Unique ID for your Application.

properties.ApplicationId

string

The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.

properties.Application_Type

ApplicationType

web

Type of application being monitored.

properties.ConnectionString

string

Application Insights component connection string.

properties.CreationDate

string

Creation Date for the Application Insights component, in ISO 8601 format.

properties.DisableIpMasking

boolean

Disable IP masking.

properties.Flow_Type

FlowType

Bluefield

Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.

properties.HockeyAppId

string

The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.

properties.HockeyAppToken

string

Token used to authenticate communications with between Application Insights and HockeyApp.

properties.ImmediatePurgeDataOn30Days

boolean

Purge data immediately after 30 days.

properties.IngestionMode

IngestionMode

ApplicationInsights

Indicates the flow of the ingestion.

properties.InstrumentationKey

string

Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component.

properties.PrivateLinkScopedResources

PrivateLinkScopedResource[]

List of linked private link scope resources.

properties.Request_Source

RequestSource

rest

Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.

properties.RetentionInDays

integer

90

Retention period in days.

properties.SamplingPercentage

number

Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.

properties.TenantId

string

Azure Tenant Id.

properties.provisioningState

string

Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.

tags

object

Resource tags

type

string

Azure resource type

ApplicationType

Type of application being monitored.

Name Type Description
other

string

web

string

FlowType

Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.

Name Type Description
Bluefield

string

IngestionMode

Indicates the flow of the ingestion.

Name Type Description
ApplicationInsights

string

ApplicationInsightsWithDiagnosticSettings

string

LogAnalytics

string

PrivateLinkScopedResource

The private link scope resource reference.

Name Type Description
ResourceId

string

The full resource Id of the private link scope resource.

ScopeId

string

The private link scope unique Identifier.

RequestSource

Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.

Name Type Description
rest

string