I'm trying to use Azure WebJobs SDK to trigger a function when a message is posted on a queue.
This works fine when setting StorageConnectionString to a connection string with the storage account key.
I would like to use a Shared Access Token (SAS) which has access to that queue (and only that) in the StorageConnectionString but getting errors:
Message=Failed to validate Microsoft Azure WebJobs SDK Storage connection string. The Microsoft Azure Storage account connection string is not formatted correctly. Please visit http://msdn.microsoft.com/en-us/library/windowsazure/ee758697.aspx for details about configuring Microsoft Azure Storage connection strings.
And:
Message=The account credentials for '' are incorrect. Source=Microsoft.Azure.WebJobs.Host StackTrace: at Microsoft.Azure.WebJobs.Host.Executors.DefaultStorageCredentialsValidator.<ValidateCredentialsAsyncCore>d__4.MoveNext()
The connection string I'm using is formatted this way: BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccoount.queue.core.windows.net/queuename;SharedAccessSignature=token
Any chance StorageConnectionString requires access to the whole storage account? If so, do you have an idea what I could do?
Looking at the WebjobSDK code: https://github.com/Azure/azure-webjobs-sdk/tree/dev/src it looks like the exception you are facing is thrown by the storage account parser. Looking at the code, it parses as follows:
I checked the formatting you sent using CloudStorageAccount and it seems to pass. Notice that you have an unnecessary '/' after the blob endpoint, maybe you are missing some text and that is causing the parsing to fail.