Hello @Vikas Neekhra ,
In general the URL on top of the Azure Portal it shows only after the user is authenticated under that subscription Tenant i.e. user should have subscription access.
There is a Azure CLI command to get the active directory name of the logged-in subscription.
When you do : az ad signed-in-user show
It will display all the information, look out for the attribute "userPrincipalName"
Or you can say: az ad signed-in-user show --query 'userPrincipalName'
You can use the output of the previous command and add it to build that complete URL for accessing the Virtual Machine.
Regards,
Shiva.