title: How to get the Azure AD objectid of the signed in user?
body: <p>I'm trying to invoke an ARM template that requires a PrincipalId of the currently signed in user.</p>
  
  <p><a href="https://docs.microsoft.com/en-us/azure/templates/microsoft.keyvault/vaults" rel="noreferrer">https://docs.microsoft.com/en-us/azure/templates/microsoft.keyvault/vaults</a></p>
  
  <p>I've signed in using powershell, as a guest account in the organisation's AAD.
  When I check the resulting context, I get:</p>
  
  <pre><code>Name             : [sky.sigal@ministryof.me, 5f813400-5b93-43b0-af8f-5fd04714f1ef]
  Account          : me@here.com
  SubscriptionName : SomeSubscriptionName
  TenantId         : e6d2d4cc-b762-486e-8894-4f5f540d5f31
  Environment      : AzureCloud
  </code></pre>
  
  <p>I'm wondering how to get the AAD ObjectId from the above, without string parsing "Name"?</p>
  
  <p>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).</p>
  
  <p>Thank you.</p>