Hi all. I'm trying to configure or import diagnost...
# azure
a
Hi all. I'm trying to configure or import diagnostic settings of an application insights instance which is sending diagnostics to an eventhub to be uploaded to elastic search. The problem I'm facing is two fold. 1. I can't find the right pulumi resource. I believe it should be this https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting but when I look at the resource id in the import example it is a resource of provider type microsoft.logic/workflows/---/diagnosticSettings/--- where my resource ID I see though the Azure Portal is of provider type microsoft.insights/components/---/providers/microsoft.insights/diagnosticSettings/--- If I attempt to import using the resource ID I see in the portal I get an error saying the resource doesn't exist. 2. Even using the az cli on the application insight component I can't list the diagnostic settings. I get back an empty array. the command I'm using is. az monitor diagnostic-settings list --resource /subscriptions/---/resourceGroups/---/providers/microsoft.insights/components/--- Am I missing something obvious? There must be a way to configure diagnostic settings with the CLI and IAC.
m
Hi Michael! I’m not very familiar with this area, but I know DiagnosticSettings are confusing. A few thoughts: • When you say the resource id in the import example it is a resource of provider type microsoft.logic/workflows/, I think this example is actually creating, not importing, a DiagnosticSetting, and the resource_uri is the resource that is being monitored. The MS docs make this a little clearer: Creates or updates diagnostic settings for the specified resource. • At the bottom of the Pulumi docs page is an import example:
pulumi import azure-native:insights:DiagnosticSetting mysetting /subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/mysetting
Regarding
If I attempt to import using the resource ID I see in the portal I get an error saying the resource doesn’t exist.
could you share the import command or code snippet you’re using? I hope that helps a little.