I'm trying to invoke an ARM template that requires a PrincipalId of the currently signed in user.
https://learn.microsoft.com/en-us/azure/templates/microsoft.keyvault/vaults
I've signed in using powershell, as a guest account in the organisation's AAD. When I check the resulting context, I get:
Name : [sky.sigal@ministryof.me, 5f813400-5b93-43b0-af8f-5fd04714f1ef]
Account : me@here.com
SubscriptionName : SomeSubscriptionName
TenantId : e6d2d4cc-b762-486e-8894-4f5f540d5f31
Environment : AzureCloud
I'm wondering how to get the AAD ObjectId from the above, without string parsing "Name"?
Note that the documentation for the ARM Template is not very clear so not sure if me@here.com would work just as well (am assuming it's talking about a Guid).
Thank you.