Skip to content
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

Add-MgServicePrincipalKey: Resource does not exist or one of its queried reference-property objects are not present #2814

Open
qizu0302 opened this issue Jun 26, 2024 · 0 comments

Comments

@qizu0302
Copy link

Describe the bug

Currently when I run
"Add-MgServicePrincipalKey -ServicePrincipalId $spoappid -BodyParameter $params -Verbose",
it always shows error “Add-MgServicePrincipalKey : Resource '00000003-0000-0ff1-ce00-000000000000' does not exist or one of its queried reference-property objects are not present.”

In my command, $spoappid is '00000003-0000-0ff1-ce00-000000000000', while $params is
$params = @{
keyCredential = @{
type = "AsymmetricX509Cert"
usage = "Verify"
key = [System.Text.Encoding]::ASCII.GetBytes("MIIDYDCCAki...")
}
passwordCredential = $null
proof = "eyJ0eXAiOiJ..."
}

According to this part in our document Configure server-to-server authentication from SharePoint Server to SharePoint in Microsoft 365,
image

I wonder where I can find the source code of Add-MgServicePrincipalKey so that I can troubleshoot my error by myself?

Expected behavior

This PS cmdlet can work without any errors.

How to reproduce

$spoappid="00000003-0000-0ff1-ce00-000000000000"

Import-Module Microsoft.Graph.Applications

$params = @{
keyCredential = @{
type = "AsymmetricX509Cert"
usage = "Verify"
key = [System.Text.Encoding]::ASCII.GetBytes("MIIDYDCCAki...")
}
passwordCredential = $null
proof = "eyJ0eXAiOiJ..."
}

Add-MgServicePrincipalKey -ServicePrincipalId $spoappid -BodyParameter $params

SDK Version

2.19.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@qizu0302 qizu0302 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jun 26, 2024
@timayabi2020 timayabi2020 added Status: Needs Investigation and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants