2

I am having trouble connecting my Logic App to an Azure Storage Queue. I followed MS guide for setting it up: https://learn.microsoft.com/en-us/azure/logic-apps/create-managed-service-identity

Here is my test Logic App to post something to my queue:

enter image description here

enter image description here

enter image description here

When my Logic App is triggered I get an error:

enter image description here

AuthenticationFailed.Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

Why is it requiring me to include an Authorization Header, when I stated that I want to use Managed Identity? As far as I have read on MS docs, the Queues do support Managed Identities.

Oliver Nilsen
  • 1,017
  • 2
  • 12
  • 32
  • Do you have any other concerns? – Jim Xu May 26 '20 at 12:33
  • I saw that the in my screenshots here I didn't have the "/messages" in my URL. So it should be https://saqueuespoc.queue.core.windows.net/myqueue01/messages. Without '/messages' in the URL in just gives HTTP 405 Unsupported Verb error. So the main solution for HTTP 403 error with using Managed Identity is to include "x-ms-version" in the request like you stated below. – Oliver Nilsen May 28 '20 at 08:31

2 Answers2

3

According to my test, if we want to call Azure queue storage rest API with Azure AD auth, we need to specify x-ms-version in the request header and its value should be 2017-11-09 or higher. Otherwise, we will get error 403. For more details, please refer to the document and the document

My test is as below 1. If I do not specify x-ms-version, I get the error

enter image description here

  1. If I specify x-ms-version, it is ok

My request Headers in HTTP action

 "Content-Type": "application/xml",
  "x-ms-date": "@{utcNow('R')}",
  "x-ms-version": "2019-07-07"

enter image description here

Result:

enter image description here

Jim Xu
  • 21,610
  • 2
  • 19
  • 39
  • 1
    Hi Jim, thx for the help. It works now. The reason I didn't have x-ms-version to begin with is because I checked out this https://learn.microsoft.com/en-us/rest/api/storageservices/put-message and it states that x-ms-version parameter is optional. It must be a mistake from MS side, as you were kind to help, that this is actually required. As soon as I provided the x-ms-version parameter it worked and I didn't get the HTTP 403 error. – Oliver Nilsen May 28 '20 at 08:26
  • @OliverNilsen Since your issue has been resolved, could you please accept the answer? It may help more people. – Jim Xu May 28 '20 at 08:27
  • I did right after answering on your comment. I also submitted feedback to MS about this paramater and sent a link to this SO post. – Oliver Nilsen May 28 '20 at 08:34
1

This worked for me: Put/Post JSON message to Azure Storage Queue via Logic App

Final result in Logic App designer enter image description here

Oliver Nilsen
  • 1,017
  • 2
  • 12
  • 32