Hey all, I was hoping to get some assistance with ...
# azure
a
Hey all, I was hoping to get some assistance with an issue creating Azure Application Insights with a Log Analytics Workspace. I read the ticket here which offered some clarification to use a particular version of the API (v20200202). However, I still receive this error: error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Cannot set LogAnalytics as IngestionMode on current api-version" InnerError={"trace":["System.ArgumentException"]}. I am wondering if I am missing something obvious? But, I am a bit at a loss for what else to try. I will add more detail in the thread.
the creation of the account is more or less this:
using Pulumi.AzureNative.Insights.V20200202; var appInsights = new Component(name, new ComponentArgs { ApplicationType = "web", Kind = "web", ResourceName = name, ResourceGroupName = context.ResourceGroupName, WorkspaceResourceId = workspaceId, });
image.png
m
Hi Ethan, this is weird. I double-checked the Azure API specs that the Pulumi provider is generated from, and it says that
LogAnalytics
is the default in version 20200202:
Copy code
"IngestionMode": {
          "type": "string",
          "description": "Indicates the flow of the ingestion.",
          "default": "LogAnalytics",
          "enum": [
            "ApplicationInsights",
            "ApplicationInsightsWithDiagnosticSettings",
            "LogAnalytics"
          ],
        }
That seems like an Azure issue at first glance. You could try the newest available API version V20220615, or the older version V20150501.
l
@adorable-television-86106 @melodic-tomato-39005 Do either of you know if there was any resolution to this? I need to move our app insights resources to the new "workspace-based" approach, and I'm at a loss as to what I need to change. See: https://pulumi-community.slack.com/archives/CRVK66N5U/p1697209266473199
a
So, what I ended up doing at the time time was referencing a particular version of the AzureNative.Insights:
using Pulumi.AzureNative.Insights.V20200202;
And setting property WorkspaceResourceId to the full azure resource URL = /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{Name} I haven't been back since -- so there may be a more optimal way to resolving it?
l
The issue you linked to says "closed" and that it was updated to the correct API version - however that works. I'll be taking a stab at it next week, so we'll see how it goes. Thanks for the reply.
a
feel free to reach out if you get stuck
197 Views