Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefajers authored Feb 5, 2024
1 parent d93e9c1 commit dd072e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internal/functions/Get-AzOpsCurrentPrincipal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
'ManagedService' {
# Get managed identity application id via IMDS (https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token)
$restMethodResult = Invoke-RestMethod -Uri "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2021-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F" -Headers @{ Metadata = $true } -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
if ($restMethodResult) {
if ($restMethodResult.client_id) {
$principalObject = Get-AzADServicePrincipal -ApplicationId $restMethodResult.client_id -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
}
}
Expand Down

0 comments on commit dd072e5

Please sign in to comment.