Skip to content

Instantly share code, notes, and snippets.

@Splaxi
Last active May 3, 2021 06:55
Show Gist options
  • Save Splaxi/e7f58078c1792bc5eaaa8d2718ee2357 to your computer and use it in GitHub Desktop.
Save Splaxi/e7f58078c1792bc5eaaa8d2718ee2357 to your computer and use it in GitHub Desktop.
Workbook - Azure Logic App - Open directly
//If you are a guest in a customer AAD, and need to access data on their sub:
//[CustomerAADName] = contoso.com
strcat("https://portal.azure.com/[CustomerAADName]/#blade/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/", url_encode(replace(@'/ACTIONS/.+',@'',ResourceId)))
//If your account is user account in the AAD
strcat("https://portal.azure.com/#blade/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/", url_encode(replace(@'/ACTIONS/.+',@'',ResourceId)))
//The above example if based on failed actions, because we want to know the action in our overview, but then be able to click on the link to open the entire logic app run in a new tab, and don't have to "guess where the last error" failed, we know that from the overview. That also explains why we do a replace on /Actions/. This might NOT be needed in your example.
//The real trick is to encode the part of the "/subscriptions/...", containing the subscriptionid, resource groups name, logic app name and the runid.
//To test in a browser directly, simply visit a run on a logic app, copy from "/subscriptions/..." and until the end of the url.
//E.g. /subscriptions/eba2c5be-d9d8-4efa-b23a-a182e70a6e87/resourceGroups/RG-DEV/providers/Microsoft.Logic/workflows/LGA-Test-WorkBook/logicApp
//Sanitize the url - remove the /logicApp part, insert "/Runs" instead.
//E.g. /subscriptions/eba2c5be-d9d8-4efa-b23a-a182e70a6e87/resourceGroups/RG-DEV/providers/Microsoft.Logic/workflows/LGA-Test-WorkBook/runs
//Append the Identifier, RunId from the Logic App run.
//E.g. /subscriptions/eba2c5be-d9d8-4efa-b23a-a182e70a6e87/resourceGroups/RG-DEV/providers/Microsoft.Logic/workflows/LGA-Test-WorkBook/runs/08585854436999088082295436564CU35
//Encode the entire string.
//E.g. %2Fsubscriptions%2Feba2c5be-d9d8-4efa-b23a-a182e70a6e87%2FresourceGroups%2FRG-DEV%2Fproviders%2FMicrosoft.Logic%2Fworkflows%2FLGA-Test-WorkBook%2Fruns%2F08585854436999088082295436564CU35
//Concatenate the base uri, NON-ENCODED, with the encoded part.
//E.g. https://portal.azure.com/#blade/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/%2Fsubscriptions%2Feba2c5be-d9d8-4efa-b23a-a182e70a6e87%2FresourceGroups%2FRG-DEV%2Fproviders%2FMicrosoft.Logic%2Fworkflows%2FLGA-Test-WorkBook%2Fruns%2F08585854436999088082295436564CU35
//Insert the entire url directly to the browser, where you already have an active / authenticated sessions against https://portal.azure.com
@Splaxi
Copy link
Author

Splaxi commented May 2, 2021

It was inspired by the work of Toon Vanhoutte and his blog post: https://yourazurecoach.com/2018/12/08/navigate-directly-to-the-logic-apps-run-details/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment