【问题标题】:Why does turning on Application Insights on a App Service crash the app?Why does turning on Application Insights on a App Service crash the app?
【发布时间】:2022-12-19 10:02:02
【问题描述】:

I have turned on Application Insights on my app service. Everytime I try to run the app or login using the app it gives an error:

An error has occurred. Please call support or your account manager if this error persists

When i looked in the Application errors under Logging,I get the following:

 System.ApplicationException: The trace listener AzureBlobTraceListener is disabled. 
 ---> System.InvalidOperationException: The SAS URL for the cloud storage account is not 
 specified. Use the environment variable 
 'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL' to define it.

Im assuming I need to add the following in the Configuration of the App Service:

  {
    "name": "DIAGNOSTICS_AZUREBLOBCONTAINERSASURL",
    "value": <URL>,
    "slotSetting": true
  },

But what is the and where can i find it ? Or is there a different error causing the app to crash once application insights is enabled, has anyone experienced this ?

【问题讨论】:

  • Comments are not for extended discussion; this conversation has been moved to chat.

标签: azure-application-insights


【解决方案1】:

I can see you have configured DIAGNOSTICS_AZUREBLOBCONTAINERSASURL without providing the value.

Get the Blob service SAS URL value from the Storage Account.

  • In Azure Portal => Create a Storage Account.
  • Initially the option to generate SAS is disabled for me.

  • Navigate to your Storage Account => Shared access signature = > select Container and Object checkboxes.

An option to Generate SAS and connection string will be enabled.

  • Copy the Blob service SAS URL and provide the value in either local Configuration settings or in Azure App Service => Configuration => Application Settings.

In Azure App Service Settings

Save the settings and access the URL.

My question before is that once i generate Generate SAS and Conection string and copy to clip board.

  • Even if you generate the SAS again, the value will be same till here - https://yourSA.blob.core.windows.net/?sv=2021-06-08&amp;ss=*****=co&amp;sp=******&amp;se=2022-12-05T14:.

  • Even we can add the SAS token in App settings automatically. Follow the below steps.

  • In Azure App Service => App Service logs = >set Application logging (Blob) to On and continue the steps to add the Storage Account. If you don't have create a new Storage Account.

"Unable to find mscorlib assembly reference:.

  • Make sure you are using the latest package references.

  • Update the framework version 4.7.2 to 4.8 in VS. Rebuild and Re-deploy the App.

【讨论】:

    猜你喜欢
    • 2022-12-01
    • 2013-10-31
    • 2022-12-01
    • 2022-12-01
    • 2022-12-26
    • 1970-01-01
    • 2022-07-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多