Skip to content

New-AzADAppCredential certificate does not show in portal #11825

Open
@ghost

Description

Description

When attempting to create a new certificate-based credential for an existing service principal, the certificate is created, but does not show in the portal (App registrations > {app_name} > certificates & secrets), whereas, using the same technique to create the certificate but generating a new service principal, the certificate shows up.

Steps to reproduce

As per your docs:

# Create self-signed cert:
$oCert = New-SelfSignedCertificate `
  -CertStoreLocation "cert:\CurrentUser\My" `
  -Subject "CN=Test2020" `
  -KeySpec KeyExchange

$KeyValue = [System.Convert]::ToBase64String($oCert.GetRawCertData())

# Get AD APP
$MyApp = Get-AzADApplication -DisplayName "Test2020"

#Create and assign credential
$MyApp | New-AzADAppCredential -CertValue $KeyValue -StartDate $oCert.NotBefore -EndDate $oCert.NotAfter

# Check portal - not showing.
# Check with PowerShell

Get-AzADAppCredential -ApplicationObject $oAADApp

#Output
StartDate           EndDate             KeyId                                Type
---------           -------             -----                                ----
06/05/2020 22:45:11 06/05/2021 23:05:11 46a3d10d-a65d-266a-55d5-0ddae26a6a3a AsymmetricX509Cert

image

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.13.0     Az.Resources                        {Add-AzADGroupMember, Export-AzResourceGroup, Get-AzADAppCredential, Get-AzADApplication...}

Debug output

Happy to share privately with MS.

Error output

No errors produced.

Discussed in https://github.com/MicrosoftDocs/azure-docs/issues/41433

Metadata

Metadata

Assignees

Labels

AADAzAd cmdlets in Az.Resourcescustomer-reportedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions