Q:

How to programmatically generate/get a link to Azure's Portal for a resource? 

Give a list of resources from Azure's Rest API via Resources - List.  Is there a way I can reliability generate or fetch a link to the Azure Portal's (portal.azure.com) overview of that resource? 

A:

To deeplink a resource in the portal, here's the logic we're using to create the link:
[portal-url]/#@[tenant-id]/resource/[resource-id]

Where
[portal-url]: https://portal.azure.com
[tenant-id]: something.onmicrosoft.com or tenant guid
[resource-id]: Id of the resource returned through resource list API call

