sparse-intern-71089
01/11/2022, 8:59 AMbillowy-army-68599
adorable-airport-36662
01/11/2022, 4:41 PMconst appInsights = new azure.appinsights.Insights(
componentName,
{
resourceGroupName: resourceGroupName,
location: location,
name: componentName,
applicationType: "web"
},
{ parent: resourceGroup });
const appInsightsApiKey = new azure.appinsights.ApiKey(
componentName, {
name: componentName,
applicationInsightsId: appInsights.id,
readPermissions: ["aggregate", "api", "draft", "extendqueries", "search"],
},
{ parent: appInsights });adorable-airport-36662
01/12/2022, 2:35 AMcreate-replacement issue by replacing the casing in the appInsightsId like below. But it feels hacky. Do you have any idea why this is working or have any other approach in mind? thanks!
const appInsightsApiKey = appInsights.id.apply(id => new azure.appinsights.ApiKey(
componentName, {
name: componentName,
applicationInsightsId: id.replace(/microsoft.insights/g, "Microsoft.Insights"),
readPermissions: ["aggregate", "api", "draft", "extendqueries", "search"],
},
{ parent: appInsights }));