https://pulumi.com logo
#azure
Title
# azure
a

adorable-television-86106

07/28/2023, 9:06 PM
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

melodic-tomato-39005

07/31/2023, 5:51 AM
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

little-library-54601

10/13/2023, 3:23 PM
@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

adorable-television-86106

10/13/2023, 4:34 PM
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

little-library-54601

10/13/2023, 4:35 PM
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

adorable-television-86106

10/13/2023, 4:37 PM
feel free to reach out if you get stuck
172 Views