Leonard
Leonard

Reputation: 49

Azure Logic App added http workflow component getting an Uri error

Part of the Azure Logic App workflow I need to send HTTPS request to our vendor site. I use HTTP Workflow component and enter URL in the follwoing format: https://username:[email protected]

I am getting the following error after workflow run: InvalidTemplate. Unable to process template language expressions in action 'HTTP_2' inputs at line '0' and column '0': 'Error converting value "https://[email protected]:[email protected]/auth/authentication/generateSecureAPIToken" to type 'System.Uri'. Path 'uri'.'.

This is how I created WebRequest component: This is the Error

Please help!

The same URL string, by the way works, when I copy and run in the Chrome browser.

Upvotes: 0

Views: 351

Answers (1)

Leonard
Leonard

Reputation: 49

This is what I found. To get an answer I used a small bit of C# code to get me an encoded base-64 string:

var request = WebRequest.Create("https://websiteUrlWithoutUserNameAndPassword....com");

string authInfo = "username:password";

authInfo = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));

From the C# debugger, take the value of authInfo string. Use it in your "Logic App" HTTP component as a header:

key: "Authorization"
value: the content of the "authInfo" string

See on the picture below

Upvotes: 0

Related Questions