-
Notifications
You must be signed in to change notification settings - Fork 31
Add New-EntraServicePrincipalKeyCredential #1487
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
base: main
Are you sure you want to change the base?
Conversation
Learn Build status updates of commit c906d57: ✅ Validation status: passed
For more details, please refer to the build report. |
Learn Build status updates of commit 37be4b6: ✅ Validation status: passed
For more details, please refer to the build report. |
Learn Build status updates of commit f8e26c2: ❌ Validation status: errorsPlease follow instructions here which may help to resolve issue.
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. |
Learn Build status updates of commit cca8030: ✅ Validation status: passedFor more details, please refer to the build report. |
Learn Build status updates of commit 47367dc: ✅ Validation status: passedFor more details, please refer to the build report. |
Learn Build status updates of commit d57bc74: ✅ Validation status: passedFor more details, please refer to the build report. |
Learn Build status updates of commit eb436cb: ✅ Validation status: passedFor more details, please refer to the build report. |
Write-Error -Message $errorMessage -ErrorAction Stop | ||
} | ||
$params["PasswordCredential"] = @{ | ||
secretText = $PSBoundParameters["CustomKeyIdentifier"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not too sure if we should support this here coz there's another command for adding password credential https://learn.microsoft.com/en-us/powershell/module/microsoft.entra/new-entraapplicationpasswordcredential?view=entra-powershell
Learn Build status updates of commit ecb7f5b: ✅ Validation status: passedFor more details, please refer to the build report. |
[System.String]$Proof, | ||
|
||
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Contain the password for the key. This property is required for keys of type X509CertAndPassword.")] | ||
[System.String]$PasswordCredential, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param is not needed.
Check the mapping below
New-EntraServicePrincipalKeyCredential
should map to New-AzureADServicePrincipalKeyCredential
.
Below are the params for New-AzureADServicePrincipalKeyCredential
https://github.com/Azure/azure-docs-powershell-azuread/blob/main/azureadps-2.0/AzureAD/New-AzureADServicePrincipalKeyCredential.md#syntax
[System.String]$Usage, | ||
|
||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = "A self-signed JWT token used as a proof of possession of the existing keys. This JWT token must be signed with a private key that corresponds to one of the existing valid certificates associated with the servicePrincipal.")] | ||
[System.String]$Proof, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param is not needed
[System.String]$Value, | ||
|
||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = "Specifies the type of key credential (e.g., AsymmetricX509Cert, Symmetric).")] | ||
[ValidateSet('AsymmetricX509Cert', 'X509CertAndPassword')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes -> https://learn.microsoft.com/en-us/graph/api/serviceprincipal-addkey?view=graph-rest-1.0&tabs=http
Supported key types are:
AsymmetricX509Cert: The usage must be Verify.
X509CertAndPassword: The usage must be Sign
[System.String]$Type, | ||
|
||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, HelpMessage = "Specifies the usage of the key credential (e.g., Sign, Verify).")] | ||
[ValidateSet('Sign', 'Verify')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only set?
We've identified an issue with the New-EntraServicePrincipalKeyCredential command in the Entra PowerShell module. While the documentation exists, the command itself does not seem to be implemented.
Here are the details:
Documentation Link: https://github.com/microsoftgraph/entra-powershell/blob/main/module/docs/entra-powershell-v1.0/Applications/New-EntraServicePrincipalKeyCredential.md
Issue: The command New-EntraServicePrincipalKeyCredential is not recognized as a valid cmdlet, function, script file, or executable program in the Entra module version 1.0.5. However, the Get-EntraServicePrincipalKeyCredential command works as expected.
#1453