-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure Tenant DSC Configuration Import Error #3422
Comments
This looks like an issue with the certificate. Please make sure to store the certificate in the computer certificate store and not your personal one. If you used the M365DSC cmdlets to create the service principal and certificate, you need to export the certificate with the private key from your personal certificate store and re-import the certificate within the computer store. PowerShell DSC's local configuration manager tries to get the certificate in the context of the local machine account.... |
Can you also share the config that contains the AADNamedLocationPolicy that fails? The one you shared only contains AADConditionalAccessPolicy instances. Thanks |
@MinskyD86 any chance you could share the other configuration file? |
I am getting the same error and it's the following block that is causing it (removing it allowed it to work perfectly)
This is something that MS have added recently as it wasn't in my tenant previously and actually errors in the GUI when I try and read the properties of it |
Not sure how you managed to get the ODataType as 'compliantNetworkNamedLocation', this is not supported. Are you able to confirm that this type is what you have on the tenant by running: Get-MgBetaIdentityConditionalAccessNamedLocation |
Ok, this is a Global Secure Preview item. Will look at adding this as part of this week's release. Thanks |
Details of the scenario you tried and the problem that is occurring
After installing M365DSC Powershell module. and successfully exporting my required components from that tenant, I was able to generate the subsequent MOF. When running Start-DscConfiguration -Path -Force -Wait -Verbose, I receive the following error:
"PowerShell DSC resource MSFT_AADNamedLocationPolicy failed to execute Test-TargetResource functionality with error message: Unable to connect to the remote server."
I'm using a service principal with certificate-based authentication. The service principal has been given all the required API permissions as advised by Microsoft documents.
Verbose logs showing the problem
VERBOSE: [SERVERNAME]: LCM: [ Start Resource ] [[AADNamedLocationPolicy]AADNamedLocationPolicy-Production]
VERBOSE: [SERVERNAME]: LCM: [ Start Test ] [[AADNamedLocationPolicy]AADNamedLocationPolicy-Production]
VERBOSE: [SERVERNAME]: [[AADNamedLocationPolicy]AADNamedLocationPolicy-Production] Testing configuration of AAD Named Location
VERBOSE: [SERVERNAME]: [[AADNamedLocationPolicy]AADNamedLocationPolicy-Production] Getting configuration of AAD Named Location
VERBOSE: [SERVERNAME]: LCM: [ End Test ] [[AADNamedLocationPolicy]AADNamedLocationPolicy-Production] in 189.4920 seconds.
PowerShell DSC resource MSFT_AADNamedLocationPolicy failed to execute Test-TargetResource functionality with error message: Unable to connect
to the remote server
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The text was updated successfully, but these errors were encountered: