Azure Application Insights API Key
This page shows how to write Terraform and Azure Resource Manager for Application Insights API Key and write them securely.
azurerm_application_insights_api_key (Terraform)
The API Key in Application Insights can be configured in Terraform with the resource name azurerm_application_insights_api_key
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_application_insights_api_key" "aikey" {
name = var.bot_name
application_insights_id = azurerm_application_insights.ai.id
read_permissions = ["aggregate", "api", "draft", "extendqueries", "search"]
resource "azurerm_application_insights_api_key" "api_keys" {
for_each = var.api_permissions
name = module.read_telemetry_name.naming_convention_output[each.key].names.0
application_insights_id = azurerm_application_insights.insight.id
read_permissions = each.value.read_permissions
write_permissions = each.value.write_permissions
resource "azurerm_application_insights_api_key" "this" {
application_insights_id = var.application_insights_id
name = var.name
read_permissions = var.read_permissions
write_permissions = var.write_permissions
resource "azurerm_application_insights_api_key" "this" {
application_insights_id = var.application_insights_id
name = var.name
read_permissions = var.read_permissions
write_permissions = var.write_permissions
Parameters
-
api_key
optional computed - string -
application_insights_id
required - string -
id
optional computed - string -
name
required - string -
read_permissions
optional - set of string -
write_permissions
optional - set of string -
timeouts
single block
Explanation in Terraform Registry
Manages an Application Insights API key.
Microsoft.Insights/components (Azure Resource Manager)
The components in Microsoft.Insights can be configured in Azure Resource Manager with the resource name Microsoft.Insights/components
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appinsights_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"components_az_func_bea_api_prod_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"channels_WebChatChannel_enablePreview": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appinsights_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"components_az_app_insight_ntto_ttsa_prod_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appinsights_name": {
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
Frequently asked questions
What is Azure Application Insights API Key?
Azure Application Insights API Key is a resource for Application Insights of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Application Insights API Key?
For Terraform, the mathieu-benoit/MyMonthlyBlogArticle.Bot, laludevops/Terraform-Azure and kevinhead/azurerm source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the microsoft/azure-data-services-go-fast-codebase, plzm/azure-deploy and InternationalTradeAdministration/deploying-arm-template-mds-prod source code examples are useful. See the Azure Resource Manager Example section for further details.