Closed mlhickey closed 2 years ago
Consider leveraging VM managed identities as auth components, looks like 3 changes:
Login-AzAccount -Identity $accessToken = (Get-AzAccessToken -ResourceTypeName MSGraph).Token Connect-MgGraph -AccessToken $accessToken $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ConnectedDateTime = [System.DateTime]::Now.ToString() $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.MultiFactorAuthentication = $true $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.Connected = $true $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.TenantId = (Get-MGContext).TenantId
FWIW I have this operational with the MSFT_AAD* resources (attendant changes in M365DSCReverse, M365DSCUtil and AAD resources)
Actually I think, this is a valid use case and could help to reduce the complexity of authentication in some scenarios. Would you be able to create a PR for this one for further review?
Consider leveraging VM managed identities as auth components, looks like 3 changes:
Login-AzAccount -Identity $accessToken = (Get-AzAccessToken -ResourceTypeName MSGraph).Token Connect-MgGraph -AccessToken $accessToken $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ConnectedDateTime = [System.DateTime]::Now.ToString() $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.MultiFactorAuthentication = $true $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.Connected = $true $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.TenantId = (Get-MGContext).TenantId
FWIW I have this operational with the MSFT_AAD* resources (attendant changes in M365DSCReverse, M365DSCUtil and AAD resources)