如何以编程方式生成/获取资源的 Azure 门户链接?

Kyl*_*ndt 1 azure

通过Resources - List 提供来自 Azure 的 Rest API 的资源列表。有没有一种方法可以可靠地生成或获取指向该资源的 Azure 门户 (portal.azure.com) 概述的链接?

Gau*_*tri 7

要在门户中深度链接资源,以下是我们用于创建链接的逻辑:

[portal-url]/#@[tenant-id]/resource/[resource-id]
Run Code Online (Sandbox Code Playgroud)

在哪里

[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