locked
Can't provision Azure Application Insights RRS feed

  • Question

  • After upgrading to Azure PowerShell 1.0.4, we are trying to provision Azure Application Insights using PowerShell. The documentation on using Service Management APIs is outdated. The new documentation relies on using the command: "New-AzureRmResourceGroupDeployment" however we do not want to use templates, we want to make each resource as needed without this.

    How can we provision a new Application Insights, defining the error level and get back the key to use it in the application? 

    Thursday, February 18, 2016 12:51 AM

Answers

  • It is possible to create this resource and get the key with the following: 

    $key = ((New-AzureRmResource `
                                  -Location “Central US” `
                                  -Properties @{"Type"="ASP.NET"} `
                                  -ResourceName $appInsightsName `
                                  -ResourceType "Microsoft.Insights/Components"  `
                                  -ResourceGroupName $resourceGroupName `
                                  –Force).Properties | select -ExpandProperty InstrumentationKey)
    

    • Marked as answer by ryan-m-w Saturday, February 20, 2016 2:46 AM
    Saturday, February 20, 2016 2:45 AM