Comments (2)
Have to ask: does the -ManagedIdentity switch not work in this scenario?
from microsoft365dsc.
Thank you for the suggestion @mlhickey.
As far as I know, the -ManagedIdentity switch can be used on a self-hosted runner is the managed identity is assigned to the VM. This is a Microsoft hosted runner, where I have configured the service connection to use Workload Identity federation to use a managed identity for authentication.
I have tested this technique in two different pipelines. Both use an AzurePowerShell@5
task to connect to Azure in which I refer my ServiceConnection as input. The Managed identity has read permissions on my Azure subscription and can connect successfully to Azure.
In my first pipeline, I try Connect-MgGraph
with the -Identity
parameter and this gives the following error:
##[error]Failed to connect to Microsoft Graph: ManagedIdentityCredential authentication unavailable. The requested identity has not been assigned to this resource.
If I use the Connect-MgGraph
with both the -Identity
and -ClientId
parameter with the Client ID of the managed identity, I get exactly the same error.
However in my second pipeline I use the -AccessToken technique for authentication and that works:
$accessToken = Get-AzAccessToken -ResourceType MSGraph -AsSecureString
Connect-MgGraph -AccessToken $accessToken.Token
After that, I can successfully query resources using graph cmdlets.
But trying to use the same technique with the -AccessTokens
parameter for the Export-M365DSCConfiguration
is failing with the above errors.
from microsoft365dsc.
Related Issues (20)
- Export: Unable to create reports from configuration exports HOT 2
- Your app has been throttled by AAD due to too many requests. HOT 10
- IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10: Error in catch block overwrites/hides original error?
- AADGroup: New group creation failing due to AssignedToRole parameter not found in the first run
- Problem exporting OrgSettings and PPTenantIsolationSettings HOT 11
- BUG? [SPOSharingSettings] throws error: "the member BccExternalSharingInvitations is not valid" HOT 9
- Export-M365DSCConfiguration: Getting `You cannot call a method on a numm-valued expression` and empty report with PowerShell 7.
- Export-M365DSCConfiguration doesn't support combination of Credential and ApplicationId
- Export-M365DSCConfiguration directly to the Azure blob container HOT 1
- New resource for Entra ID password protection settings
- Follow-Up: New-M365DSCDeltaReport: "No discrepancies have been found!" when adding an exclusion to Conditional Access Policies
- [MSCloudLoginConnectionProfile] : Not found HOT 1
- O365SearchAndIntelligenceConfigurations : Unable to export
- EXOGroupSettings: Only exports 1000 objects HOT 1
- Microsoft365DSC: Cannot bind parameter 'Certificate'. Cannot convert value "CERTIFICATETHUMBPRINT" to type "Microsoft.TeamsCmdlets.Powershell.Connect.Utilities.CertificateParameter". HOT 5
- Bug on EXODkimSigningConfig (wrong Key size value)
- O365OrgSettings issue with V1.24.626.1 HOT 3
- HELP: how to deploy sensitivity labels with [SCSensitivityLabel] - specifically how to get "update" access?
- IntuneWindowsAutopilotDeploymentProfileAzureADJoined: Creates New Resource Every Run HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft365dsc.