pulumi / pulumi-azure-native

Azure Native Provider
Apache License 2.0
128 stars 35 forks source link

Cannot set LogAnalytics as IngestionMode on current api-version #2878

Closed rkochar closed 12 months ago

rkochar commented 1 year ago

What happened?

I am building a simple hello world function app, everything works. I add a component for ApplicationInsight and a plan is made but it fails to create the resource with error

  azure-native:insights:Component (applicationinsights):
    error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Cannot set LogAnalytics as IngestionMode oncurrent api-version" InnerError={"trace":["System.ArgumentException"]}

Example

Use the app function here - it will work as expected.

Add a component,

from pulumi_azure_native.insights import Component, ApplicationType

application_insights = Component('applicationinsights',
                                 resource_group_name=resource_group.name,
                                 location=resource_group.location,
                                 application_type=ApplicationType.WEB,
                                 kind='web'
                                 )

and add to app_settings in site_config, web.NameValuePairArgs(name='APPLICATIONINSIGHTS_CONNECTION_STRING', value=application_insights.connection_string).

Output of pulumi about

CLI
Version      3.88.1
Go Version   go1.21.1
Go Compiler  gc

Plugins
NAME            VERSION
aws             6.9.0-alpha.1699538295
aws-apigateway  2.0.0-alpha.1
azure           5.56.0-alpha.1699509179
azure-native    2.16.0
gcp             7.0.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

mikhailshilkov commented 1 year ago

Hi @rkochar I believe this is caused by deprecation of non-loganalytics-based insights by Microsoft. You need to set workspaceResourceId to point the component to a workspace.