title: Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403)
body: <p>upon fresh publish this is the initial error: </p>
  
  <blockquote>
    <p>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‌​()</p>
  </blockquote>
  
  <p>I then added <code>DIAGNOSTICS_AZUREBLOBCONTAINERSASURL</code> to the application settings having its value set to 
  the  Blob service SAS URL generated. At this I get a new error:</p>
  
  <blockquote>
    <p>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(IDictionary<code>2
    queryParameters, Boolean mandatorySignedResource) at
    Microsoft.WindowsAzure.Storage.Core.Util.NavigationHelper.ParseBlobQueryAndVerify(Uri
    address, StorageCredentials&amp; parsedCredentials, Nullable</code>1&amp;
    parsedSnapshot) at
    Microsoft.WindowsAzure.Storage.Core.Util.NavigationHelper.ParseBlobQueryAndVerify(StorageUri
    address, StorageCredentials&amp; parsedCredentials, Nullable`1&amp;
    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()</p>
  </blockquote>
  
  <p>I then added <code>sr=b</code> to the '<code>DIAGNOSTICS_AZUREBLOBCONTAINERSASURL</code>' which result in the below error:</p>
  
  <blockquote>
    <p>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](RESTCommand<code>1
    cmd, IRetryPolicy policy, OperationContext operationContext)
    --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand</code>1
    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</p>
  </blockquote>
  
  <p>Connection string used to declare AzureWebJobsDashboard and AzureWebJobsStorage in app settings:
  <a href="https://i.stack.imgur.com/QGb2G.png" rel="nofollow noreferrer">enter image description here</a></p>