squigg / azure-queue-laravel

PHP Laravel Queue Driver package for Microsoft Azure Storage Queues
41 stars 24 forks source link

MalformedToken #16

Closed vitortcmiranda closed 2 years ago

vitortcmiranda commented 3 years ago

I'm getting 401 Malformed Token when trying to send a message to the queue, any suggestion where i should start looking for?

MicrosoftAzure\Storage\Common\Exceptions\ServiceException: Fail: Code: 401 Value: Unauthorized details (if any): 401MalformedToken: The credentials contained in the authorization header are not in the WRAP format. TrackingId:0a964ef4-6456-48f3-9596-c8bds1da9d23f_G17, SystemTracker:queue-name.servicebus.windows.net:myqueue, Timestamp:2020-11-19T16:59:41. in /application/vendor/microsoft/azure-storage-common/src/Common/Internal/ServiceRestProxy.php:496

Copy of your config/queue.php file 'azure' => [ 'driver' => 'azure',
'protocol' => 'https',
'accountname' => env('AZURE_QUEUE_STORAGE_NAME'),
'key' => env('AZURE_QUEUE_KEY'),
'queue' => "myqueue", 'timeout' => 60, 'endpoint' => env('AZURE_QUEUE_ENDPOINTSUFFIX'), ],

Software versions This Package: Laravel: ^6.0 Lumen: ^6.2 PHP: 7.3 Operating System: Linux

Any other information

squigg commented 3 years ago

I've not seen this error before, but it's possible that the environment variables for the AZURE_QUEUE_STORAGE_NAME and AZURE_QUEUE_KEY are not set correctly. I can see a value queue-name populated in the error message, but that's not a valid storage account name.

Can you double check that these are set in your .env file to the appropriate storage account name and the storage account key? Can you also ensure that the AZURE_QUEUE_ENDPOINTSUFFIX is set to the default of core.windows.net?

I am not sure why the error message references the service bus, as this driver is intended for storage account queues...

squigg commented 2 years ago

I hope you got this sorted. Please open a new issue if the problem persists.