2

upon fresh publish this is the initial error:

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.at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceLi‌​stener.RefreshConfig‌​()

I then added DIAGNOSTICS_AZUREBLOBCONTAINERSASURL to the application settings having its value set to the Blob service SAS URL generated. At this I get a new error:

System.ApplicationException: The trace listener AzureBlobTraceListener is disabled. ---> System.ArgumentException: Missing mandatory parameters for valid Shared Access Signature at Microsoft.WindowsAzure.Storage.Core.Auth.SharedAccessSignatureHelper.ParseQuery(IDictionary2 queryParameters, Boolean mandatorySignedResource) at Microsoft.WindowsAzure.Storage.Core.Util.NavigationHelper.ParseBlobQueryAndVerify(Uri address, StorageCredentials& parsedCredentials, Nullable1& parsedSnapshot) at Microsoft.WindowsAzure.Storage.Core.Util.NavigationHelper.ParseBlobQueryAndVerify(StorageUri address, StorageCredentials& parsedCredentials, Nullable`1& parsedSnapshot) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.ParseQueryAndVerify(StorageUri address, StorageCredentials credentials) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer..ctor(StorageUri containerAddress, StorageCredentials credentials) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.RefreshConfig()

I then added sr=b to the 'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL' which result in the below error:

Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadBlockList(BlockListingFilter blockListingFilter, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer() Request Information RequestID:5225782d-0001-0175-6d94-fc82dd000000 RequestDate:Fri, 14 Jul 2017 11:33:16 GMT StatusMessage:Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. ErrorCode:AuthenticationFailed

Connection string used to declare AzureWebJobsDashboard and AzureWebJobsStorage in app settings: enter image description here

Keshav Taurah
  • 173
  • 1
  • 1
  • 12
  • Welcome to StackOverflow. Please edit your question with better format, and provide more context of your problem, or people are not able to help you via just an exception stack trace. – Zhaoxing Lu Jul 14 '17 at 12:04
  • added some description thanks – Keshav Taurah Jul 14 '17 at 12:20
  • According to your description, we still couldn't find the reason why you get the 403 error. Could you please tell us what you have done? Do enable the Diagnostics logs in the azure web app portal or run the storage SDK in your application codes? – Brando Zhang Jul 17 '17 at 02:05
  • upon fresh publish this is the initial error: 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.at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.RefreshConfig() – Keshav Taurah Jul 17 '17 at 06:18
  • @BrandoZhang-MSFT I added DIAGNOSTICS_AZUREBLOBCONTAINERSASURL in the application settings,setting its value to the Blob service SAS URL generated . – Keshav Taurah Jul 17 '17 at 06:26
  • detail explanations of steps and error at each stage have been updated in question – Keshav Taurah Jul 17 '17 at 06:35

1 Answers1

8

According to your description, I guess the reason why you faced the error is your SAS token doesn't have enough permission to CRUD the blob.

The SAS token must be the blob container SAS token not the blob SAS token.

Besides, if you set the the azure web app's diagnostics logs Application Logging feature, it will auto generate a SAS token in your web app's appsetting.

More details, you could refer to below image:

Set the storage account in the diagnostics logs.

enter image description here

Then it will auto set the appsetting:

enter image description here


Update:

Failed to validate Microsoft Azure WebJobs SDK Dashboard connection string. The Microsoft Azure Storage account connection string is not formatted correctly.

If you upload a webjobs to your web app, the web jobs need two appsetting. One is the Dashboard connection string, another one is the AzureWebJobsStorage.

Both of these two setting need the storage connection string not the storage SAS.

You could find the storage connection string as below image shows:

1.Open the storage access key feature.

enter image description here

2.Copy the connection string:

enter image description here

3.Replace the connection string in the web app appsetting.

enter image description here

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65
  • same error still persist,but i notice that DateRequest field is on a different time zone,does it need inspections??: @Brando Zhang -MSFT – Keshav Taurah Jul 17 '17 at 09:32
  • How you enable the diagnostics? Directly using the web app portal or something else? – Brando Zhang Jul 17 '17 at 09:38
  • web portal directly @Brando Zhang - MSFT – Keshav Taurah Jul 17 '17 at 09:46
  • Since I don't have your application so I couldn't reproduce your error now. I suggest you could try to create another web app. Then you could check your application doesn't use any other diagnostics and publish the application to the new web app. At last follow my posts step to enable the web app diagnostics. – Brando Zhang Jul 18 '17 at 05:42
  • What is error you have seen now? Is it still the 403 auth fail error? – Brando Zhang Jul 19 '17 at 04:28
  • System.InvalidOperationException: Failed to validate Microsoft Azure WebJobs SDK Dashboard connection string. The Microsoft Azure Storage account connection string is not formatted correctly. Unhandled Exception: System.InvalidOperationException: Failed to validate Microsoft Azure WebJobs SDK Dashboard connection string. The Microsoft Azure Storage account connection string is not formatted correctly. – Keshav Taurah Jul 19 '17 at 05:52
  • Besides, could you please tell us why your application show this error? Which operation you have done for your web app? Do you enable the DIAGNOSTICS and upload a webjob to the azure web app?From your error message, it is related with azure webjobs. Since the azure webjob Dashboard connection string need the storage connection string SAS will not be worked well. I suggest you could follow my updated answer to change the Dashboard connection string. – Brando Zhang Jul 20 '17 at 00:27
  • U guess it right i did upload a webjob,,this is the guide am following :https://github.com/SharePoint/sp-dev-samples/blob/master/Samples/WebHooks.List/Deployment%20guide.md I did have those settings set up in my webconfig file,am going to try in the app setting as you suggested. @Brando Zhang - MSFT – Keshav Taurah Jul 20 '17 at 05:32
  • According to the error, it says your connectionstring format isn't right. What the connection string you have used now? If possible, I suggest you could show an image of the connection string(you could hide the part of the connection string) you have set in the web app appsetting. Besides, I suggest you could recheck you have copied the connection string not the storage key. – Brando Zhang Jul 21 '17 at 01:23
  • i have added the image in the question. – Keshav Taurah Jul 21 '17 at 05:22
  • As far as I know, if you doesn't set the dashborad connection string in the web app appsetting. In the web app log, it will still show the error message, but this doesn't affect the web app work. I suggest you could set the connection string in the web app's appsetting in the azure web portal. This will solve this error. If this doesn't work, I suggest you could firstly run the webjob in the local with the right appsetting in the App.config file. – Brando Zhang Jul 24 '17 at 05:30