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

Test-MgServicePrincipalSynchronizationJobCredential do not return bool value #2977

Open
MasterKuat opened this issue Sep 30, 2024 · 1 comment

Comments

@MasterKuat
Copy link

Describe the bug

I'm testing new credential validatity for ServicePrincipal sync job (Enterprise app / SCIM job).
Per documentation this cmdlet must return boolean.

But if credential is correct, the cmdlet return nothing.

API return a status 204, No Content as expected.
Surely the root cause.

If credential is wrong, cmdlet report an error.

Expected behavior

Return $True or $False without Error

How to reproduce

$params = @{
credentials = @(
@{
"key" = "BaseAddress"
"value" = "mytenantURL"
},
@{
"key" = "SecretToken"
"value" = "MySecretToken"
}
)
}

Test-MgServicePrincipalSynchronizationJobCredential -ServicePrincipalId $EnterpriseApp.Id -SynchronizationJobId $Syncjob.Id -BodyParameter $params

SDK Version

2.23.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```

DEBUG: [CmdletBeginProcessing]: - Test-MgServicePrincipalSynchronizationJobCredential begin processing with parameterSet 'Validate'.
DEBUG: [Authentication]: - AuthType: 'ManagedIdentity', TokenCredentialType: 'ManagedIdentity', ContextScope: 'Process', AppName: 'MyIdentity'.
DEBUG: [Authentication]: - Scopes: [Application.ReadWrite.OwnedBy].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://graph.microsoft.com/v1.0/servicePrincipals/spnID/synchronization/jobs/synJobID/microsoft.graph.validateCredentials

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.19045; fr-FR),PowerShell/5.1.19041.4894
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.23.0
client-request-id : 10664500-1ad6-412f-83ef-e182f355edbb

Body:
{
"credentials": [
{
"key": "BaseAddress",
"value": "mytenantURL"
},
{
"key": "SecretToken",
"value": "MySecretToken"
}
]
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NoContent

Headers:
Strict-Transport-Security : max-age=31536000
request-id : 347f6935-9739-42c1-be16-64b9f897e521
client-request-id : 10664500-1ad6-412f-83ef-e182f355edbb
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"010","RoleInstance":"AM4PEPF000355B9"}}
Date : Mon, 30 Sep 2024 12:34:27 GMT

Body:

DEBUG: [CmdletEndProcessing]: - Test-MgServicePrincipalSynchronizationJobCredential end processing.

</details>


### Configuration

Name                           Value                                                                                                                                                                                                                                              
----                           -----                                                                                                                                                                                                                                              
PSVersion                      5.1.19041.4894                                                                                                                                                                                                                                     
PSEdition                      Desktop                                                                                                                                                                                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                            
BuildVersion                   10.0.19041.4894                                                                                                                                                                                                                                    
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                    
WSManStackVersion              3.0                                                                                                                                                                                                                                                
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                
SerializationVersion           1.1.0.1
OS : Win10
Architecture: x64


### Other information

_No response_
@MasterKuat MasterKuat added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 30, 2024
@timayabi2020
Copy link
Contributor

Hi @MasterKuat thank you for raising this issue. This is indeed an issue with the PowerShell reference documentation. Kindly allow us to investigate why the output documented in the reference document does not coincide with what has been documented in the API reference document.

As for the request in regard to API response having a Boolean value for both success and fail scenarios, please raise an issue here so that the service owner can respond to it.

@timayabi2020 timayabi2020 added Bug: Documentation and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 22, 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