-
Notifications
You must be signed in to change notification settings - Fork 527
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
Error: Cannot bind argument to parameter 'ServicePrincipalId' because it is an empty string.. #3842
Comments
Environment information for this issue:
|
To begin the investigation, let's make sure that the service principal for Office on the Web is registered on your tenant. What is the outcome of running the following command against the tenant? You will need to connect to Graph first either using Connect-M365Tenant -Workload MicrosoftGraph or Connect-MgGraph. $OfficeOnlineId = 'c1f33bc0-bdb4-4248-ba9b-096807ddb43e'
Get-MgServicePrincipal -Filter "appId eq '$OfficeOnlineId'" -Property 'AccountEnabled, Id' |
Connect-MgGraph -Scopes $RequiredScopes
Welcome To Microsoft Graph!
$OfficeOnlineId = 'c1f33bc0-bdb4-4248-ba9b-096807ddb43e'
Get-MgServicePrincipal -Filter "appId eq '$OfficeOnlineId'" -Property 'AccountEnabled, Id' Returns null. |
Thanks, we are investigating with the proper team internally to understand what could cause that service principal not to be registered on your tenant and will get back to you ASAP. |
It appears that this service principal gets registered the first time someone change the setting via the UI. I am assuming you were running into the error because this setting was never modified previously. An option is to force register it by running: New-MgServicePrincipal -AppId 'c1f33bc0-bdb4-4248-ba9b-096807ddb43e' -ErrorAction Stop Which will then fix the issue within the DSC resource. On our end, we will add a check in the resource to check if the service principal is registered against the tenant or not, and if it isn't then we will use the code above to register it automatically. This will fix the issue for future tenants where it's not already registered as well. |
Description of the issue
Hello,
I recently made changes to set some O365OrgSettings configs. The specific one I am having issue with setting is the
M365WebEnableUsersToOpenFilesFrom3PStorage
setting to$false
. When this is deployed, I am seeing the following error:I looked into the code and it is failing here. It seems that we are passing in nothing to the
ServicePrincipalId
flag forUpdate-MgservicePrincipal
. This flag is being set by$M365WebEnableUsersToOpenFilesFrom3PStorageValue
, which is loaded in byGet-MgServicePrincipal
.I see
Get-MgServicePrincipal
is called 5 times in that file. For the other 4 occurrences, there are$null
checks for result. However, for this call, there are no$null
checks. Is this expected?Also, I noticed that the
CortanaEnabled
configuration follows a similar pattern to theM365WebEnableUsersToOpenFilesFrom3PStorage
configuration I am having issues with. However, theCortanaEnabled
does have the$null
check here. It also has another check here that theM365WebEnableUsersToOpenFilesFrom3PStorage
does not have either. Do we need to add these checks toM365WebEnableUsersToOpenFilesFrom3PStorage
code?Please let me know if you need any other details from my side.
Microsoft 365 DSC Version
V1.23.1011.1
Which workloads are affected
Office 365 Admin
The DSC configuration
The text was updated successfully, but these errors were encountered: