adorable-airport-36662
01/11/2022, 8:59 AMcreate-replacement
but actually nothing has changed in the appinsights nor the appinsights apikey. This is the diff logs:
++ azure:appinsights/apiKey:ApiKey (create-replacement)
[id=/subscriptions/[id]/resourcegroups/[resourceGroupName]/providers/microsoft.insights/components/[resourceGroupName]/apiKeys/[keyId]]
__meta : "{"....":{"create":1800000000000,"delete":1800000000000,"read":300000000000,"update":1800000000000},"schema_version":"1"}"
apiKey : "[secret]"
applicationInsightsId: "/subscriptions/[id]/resourceGroups/[resourceGroupName]/providers/Microsoft.Insights/components/[resourceGroupName]" => "/subscriptions/[id]/resourceGroups/[resourceGroupName]/providers/microsoft.insights/components/[resourceGroupName]"
id : "/subscriptions/[id]/resourcegroups/[resourceGroupName]/providers/microsoft.insights/components/[resourceGroupName]/apiKeys/[keyId]"
writePermissions : []
Does anyone have this issue as well? Any help is much appreciated! thanks!billowy-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 });
create-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 }));