Delen via


New-AzOperationalInsightsApplicationInsightsDataSource

Verzamel logboeken van de opgegeven Application-Insights-toepassing.

Syntaxis

New-AzOperationalInsightsApplicationInsightsDataSource
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzOperationalInsightsApplicationInsightsDataSource
   [-Workspace] <PSWorkspace>
   -ApplicationSubscriptionId <String>
   -ApplicationResourceGroupName <String>
   -ApplicationName <String>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzOperationalInsightsApplicationInsightsDataSource
   [-Workspace] <PSWorkspace>
   -ApplicationResourceId <String>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzOperationalInsightsApplicationInsightsDataSource
   [-ResourceGroupName] <String>
   [-WorkspaceName] <String>
   -ApplicationSubscriptionId <String>
   -ApplicationResourceGroupName <String>
   -ApplicationName <String>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzOperationalInsightsApplicationInsightsDataSource
   [-ResourceGroupName] <String>
   [-WorkspaceName] <String>
   -ApplicationResourceId <String>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Met de cmdlet New-AzOperationalInsightsApplicationInsightsDataSource kunt u logboeken uit een bepaalde Application-Insights-toepassing verzamelen.

Voorbeelden

Voorbeeld 1: Application Insights-gegevensbron maken in werkruimte

New-AzOperationalInsightsApplicationInsightsDataSource -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "MyWorkspace" -ApplicationSubscriptionId "e791a474-ee54-46a2-bb06-5e058302d234" -ApplicationResourceGroupName "ContosoResourceGroup" -ApplicationName "MyAIApplication"

Name              : subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication
ResourceGroupName : ContosoResourceGroup
WorkspaceName     : MyWorkspace
ResourceId        : /subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace/datasources/subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication
Kind              : ApplicationInsights
Properties        : {"linkedResourceId":"subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication","status":"Succeeded"}

Met deze opdracht maakt u een application-insights-gegevensbron van een bepaalde toepassing in een bepaalde Log Analytics-werkruimte. Hiermee kunt u logboeken van de opgegeven toepassing verzamelen naar de Log Analytics-werkruimte.

Voorbeeld 2: Werkruimteobject ophalen en application-insights-gegevensbron maken op basis van de resource-id van de toepassing

Get-AzOperationalInsightsWorkspace -Name "MyWorkspace" -ResourceGroupName "ContosoResourceGroup" | New-AzOperationalInsightsApplicationInsightsDataSource -ApplicationResourceId "/subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication"

Name              : subscriptions/aaaaa474-ee54-4aaa-bb06-5e058302daaa/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication
ResourceGroupName : ContosoResourceGroup
WorkspaceName     : MyWorkspace
ResourceId        : /subscriptions/aaaaa474-ee54-4aaa-bb06-5e058302daaa/resourceGroups/ContosoResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace/datasources/subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication
Kind              : ApplicationInsights
Properties        : {"linkedResourceId":"subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication","status":"Succeeded"}

Met deze opdracht wordt gedemonstreerd hoe u een Log Analytics-werkruimteobject ophaalt en vervolgens de uitvoer doorgeeft om een gekoppelde Application Insights-gegevensbron te maken op basis van de resource-id van de toepassing.

Parameters

-ApplicationName

De naam van de gekoppelde toepassing.

Type:String
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-ApplicationResourceGroupName

De naam van de resourcegroep van de gekoppelde toepassing.

Type:String
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-ApplicationResourceId

De resource-id van de gekoppelde toepassing.

Type:String
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-ApplicationSubscriptionId

De abonnements-id van de gekoppelde toepassing.

Type:String
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-Confirm

Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.

Type:SwitchParameter
Aliassen:cf
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-DefaultProfile

De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.

Type:IAzureContextContainer
Aliassen:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Force

Vraag niet om bevestiging.

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ResourceGroupName

De naam van de resourcegroep.

Type:String
Position:1
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-WhatIf

Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.

Type:SwitchParameter
Aliassen:wi
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Workspace

De werkruimte die de gegevensbron bevat.

Type:PSWorkspace
Position:0
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-WorkspaceName

De naam van de werkruimte die de gegevensbron bevat.

Type:String
Position:2
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

Invoerwaarden

PSWorkspace

String

Uitvoerwaarden

PSDataSource