< Back

New-AzureRmApplicationInsightsApiKey

Tue Jan 29, 2019 9:31 pm

NAME New-AzureRmApplicationInsightsApiKey



SYNOPSIS

Create an application insights api key for an application insights resource





SYNTAX

New-AzureRmApplicationInsightsApiKey [-ApplicationInsightsComponent] <PSApplicationInsightsComponent> [-Permissions] {ReadTelemetry |

WriteAnnotations | AuthenticateSDKControlChannel} [-Description] <String> [-Confirm] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]

[<CommonParameters>]



New-AzureRmApplicationInsightsApiKey [-ResourceGroupName] <String> [-Name] <String> [-Permissions] {ReadTelemetry | WriteAnnotations |

AuthenticateSDKControlChannel} [-Description] <String> [-Confirm] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [<CommonParameters>]



New-AzureRmApplicationInsightsApiKey [-ResourceId] <String> [-Permissions] {ReadTelemetry | WriteAnnotations | AuthenticateSDKControlChannel}

[-Description] <String> [-Confirm] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [<CommonParameters>]





DESCRIPTION

Create an application insights api keys for an application insights resource





PARAMETERS

-ApplicationInsightsComponent <PSApplicationInsightsComponent>

Application Insights Component Object.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

Description to help identify this API key.



Required? true

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Component Name.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Permissions <String[]>

Permissions that API key allow apps to do.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Resource Group Name.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceId <String>

Application Insights Component Resource Id.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

System.String[]





OUTPUTS

Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey







NOTES









Example 1 Create a new Api Key for an application insights resource



PS C:\\>$apiKeyDescription="testapiKey"

PS C:\\>$permissions = @("ReadTelemetry", "WriteAnnotations")

PS C:\\>New-AzureRmApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions



ApiKey : st0rfelw7m3oimfspozrtwgccxihiftbdwqjdfkg

CreatedDate : Fri, 27 Oct 2017 16:59:19 GMT

Id : 1ed593f9-1561-4981-922d-6917971eecd3

Permissions : {ReadTelemetry, WriteAnnotations}

Description : testapiKey



Create application insights api key description as "testapiKey" with permissions "ReadTelemetry", "WriteAnnotations" for resource "test" in

resource group "testGroup".







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ghtsapikey