Using a managed identity and tokens - Help needed #213
gmenziesint
started this conversation in
General
Replies: 1 comment 8 replies
-
As far as I know the Managed Identity option is still not available in the Python MSAL module from MS, using tokens, this is what I have been able to use, trigger:
- none
pool:
vmImage: windows-latest
steps:
- task: AzureCLI@2
displayName: 'Get Graph Token for Workload Federated Credential'
inputs:
azureSubscription: 'test'
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
$token = az account get-access-token --resource-type ms-graph
$accessToken = ($token | ConvertFrom-Json).accessToken
Write-Host "##vso[task.setvariable variable=secretToken;issecret=true]$accessToken"
- task: PowerShell@2
displayName: 'Install IntuneCD'
inputs:
targetType: 'inline'
script: |
pip3 install IntuneCD==2.3.0b4
pwsh: true
- task: PowerShell@2
displayName: 'Run IntuneCD with token'
inputs:
targetType: 'inline'
script: |
IntuneCD-startbackup -t $(secretToken) -p $(Build.SourcesDirectory)
pwsh: true |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
Has anyone managed to get managed identities and tokens working? I'm having difficulty getting the authentication piece to work.
I can see I'm authenticating with the managed identity but the backup piece with IntuneCD is saying I have an invalid audience, just wanted to check I'm not missing anything. I've supplied a Tenant name in pipeline variables.
Full pipeline
Below is the part where I get the token, this seems to working correctly.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions