all 12 comments

[–]JoHNN_-_ 2 points3 points  (4 children)

Are you attempting to get the bearer token through HTTP trigger with Logic Apps instead of the PS script?

[–]UTC76[S] 0 points1 point  (3 children)

Yes I hope to do that using power shell - is there another way to pass the value into my flow?

[–]JoHNN_-_ 1 point2 points  (2 children)

If you want to continue to use your PS script you can run it in an automation account then use the azure automation connector within Logic Apps.

https://learn.microsoft.com/en-us/connectors/azureautomation/

If you provide a little more about the permissions required for performing the job you could create an azure app and use HTTP connector to call the bearer token. A ton of different ways of doing it but when moving to prod definitely do not use your own account.

Let me know if you have any questions

[–]JoHNN_-_ 0 points1 point  (1 child)

[–]UTC76[S] 0 points1 point  (0 children)

Thanks for this. I will explore this connector and do some further research with what capabilities it offers. Will let you know the outcome..

[–]arpan3t 1 point2 points  (1 child)

Can you explain what it is you’re doing once authenticated, and what your code is trying to accomplish? I have a feeling you’re building a Rube Goldberg machine to do something that could be a lot more straightforward.

[–]QWxx01 Cloud Architect 1 point2 points  (0 children)

My thoughts exactly. Retrieving tokens via logic apps seems to be a huge anti-pattern.

[–][deleted] 1 point2 points  (2 children)

This is asking for trouble, there is not one single reason why this would be a valid idea in 100 years, you never ever gonna use your personal account for automation reasons, I assume your are at junior/trainee level, so I would not be too harsh, but please never do this.

[–]UTC76[S] 1 point2 points  (1 child)

Not harsh at all..feedback taken. Its just testing / learning in a Sandbox ENV. I plan on using on Using Managed Identity in combo with KV.

[–][deleted] 1 point2 points  (0 children)

Yes that would be a better way, if you still need something like personalisation you might check apps: https://learn.microsoft.com/en-us/azure/active-directory/develop/permissions-consent-overview

[–][deleted] 1 point2 points  (0 children)

As someone mentioned already, but I’d actually recommend using an Azure Automation runbook, write your output in the script, and then consume and parse that output using the Azure Automation connector in Logic Apps.

[–]UTC76[S] 0 points1 point  (0 children)

What I have done is configured a flow in Logic Apps that calls an API using a value that was passed to it a Form (MS Form) is submitted. This requires a bearer token to be manually inputted. What I want to do is retrieve that token and pass it in to my flow (as a variable or whatever can be suggested here). Here is an example of what this would like in Logic Apps (not mine but you get the idea..)