Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

huangapple go评论77阅读模式
英文:

Kotlin Springboot application is unable to find connection string for Azure Application Insight

问题

I am trying to connect my Kotlin Springboot application with Azure Application Insight in local. 我正在尝试将我的Kotlin Springboot应用程序与本地的Azure Application Insight连接。

I went through the official documentation: https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-spring-boot. 我查看了官方文档:https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-spring-boot。

I have also consulted previous question like: https://stackoverflow.com/questions/75521267/no-connection-string-provided-azure-application-insights. 我还查看了类似的先前问题:https://stackoverflow.com/questions/75521267/no-connection-string-provided-azure-application-insights。

However I am still getting the error below: 但是我仍然遇到以下错误:

From 3.4.3, you can configure the name of a JSON file in the classpath with the applicationinsights.runtime-attach.configuration.classpath.file system property. For example, with -Dapplicationinsights.runtime-attach.configuration.classpath.file=applicationinsights-dev.json, Application Insights will use applicationinsights-dev.json file for configuration. 从3.4.3版本开始,您可以使用applicationinsights.runtime-attach.configuration.classpath.file系统属性配置类路径中的JSON文件的名称。例如,使用-Dapplicationinsights.runtime-attach.configuration.classpath.file=applicationinsights-dev.json,Application Insights将使用applicationinsights-dev.json文件进行配置。

This is also the solution proposed in https://stackoverflow.com/questions/75521267/no-connection-string-provided-azure-application-insights. 这也是https://stackoverflow.com/questions/75521267/no-connection-string-provided-azure-application-insights中提出的解决方案。

How to get this part done and/or how to resolve this error for Application Insight version 3.4.3. 如何完成这部分内容和/或如何解决Application Insight版本3.4.3的错误。

Thanks 谢谢。

英文:

I am trying to connect my Kotlin Springboot application with Azure Application Insight in local. I went through the official documentation: https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-spring-boot. I have also consulted previous question like: https://stackoverflow.com/questions/75521267/no-connection-string-provided-azure-application-insights. However I am still getting the error below:
Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

It did everything as per the documentation but it believe the error is due to this part:

> From 3.4.3, you can configure the name of a JSON file in the classpath with the applicationinsights.runtime-attach.configuration.classpath.file system property. For example, with -Dapplicationinsights.runtime-attach.configuration.classpath.file=applicationinsights-dev.json, Application Insights will use applicationinsights-dev.json file for configuration.

This is also the solution proposed in https://stackoverflow.com/questions/75521267/no-connection-string-provided-azure-application-insights.

How to get this part done and/or how to resolve this error for Application Insight version 3.4.3.

Thanks

答案1

得分: 1

  • 请检查您在计算机上安装的所有版本。我已安装 java version "20.0.1" 2023-04-18 和 applicationinsights-spring-boot-starter 2.6.4

  • 我尝试了与@jean_m 相同的操作,谢谢。我没有发现任何错误异常,日志正在生成。

Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

我按照以下路径设置了我的应用程序。

  • 主要
    • Kotlin
    • 资源
      • application.properties
      • applicationinsights-dev.json

Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

  • 转到应用程序JAR文件位置并运行上图中显示的命令。
  • 我能够看到我的Kotlin应用程序的日志正在触发我的应用程序洞察。

Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

英文:
  • Please check all the versions that you have installed in your machine. I have installed java version "20.0.1" 2023-04-18 and applicationinsights-spring-boot-starter 2.6.4.

  • I have tried the same as per the @jean_m thank you. I didn't find any error exception and logs are generating.

Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

I followed the below path for my application.

  • main
    • kotlin
    • resources
      • application.properties
      • applicationinsights-dev.json

Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

  • Navigate to application JAR file location and run the above command which shown in the picture.
  • I can able to see triggering the logs of my kotlin application in my application insight.

Kotlin Springboot 应用程序无法找到 Azure 应用程序洞察的连接字符串。

huangapple
  • 本文由 发表于 2023年5月6日 18:57:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76188488.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定