@@ -122,28 +122,30 @@ Creates key credentials or password credentials for an application.
122
122
123
123
## EXAMPLES
124
124
125
- ### Example 1: Create key credentials for application
125
+ ### Example 1: Create key credentials for an application
126
+
126
127
``` powershell
127
- # ObjectId is the string representation of a GUID for directory object, application, in Azure AD.
128
- $Id = "00000000-0000-0000-0000-000000000000"
129
- # $cert is Base64 encoded content of certificate
130
- $credential = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential" `
131
- -Property @{'Key' = $cert;
132
- 'Usage' = 'Verify';
133
- 'Type' = 'AsymmetricX509Cert'
134
- }
135
- New-AzADAppCredential -ObjectId $Id -KeyCredentials $credential
128
+ # $ObjectId should be the the 'Object ID' GUID associated with the Azure app registration.
129
+ # $CertificateThumbprint should be the thumbprint of the certificate.
130
+ # $Cert is the base64 encoded content of the certificate.
131
+ $ObjectId = "00000000-0000-0000-0000-000000000000"
132
+ $Credential = New-Object -TypeName `
133
+ "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential" `
134
+ -Property @{'Key' = $Cert;
135
+ 'Usage' = 'Verify';
136
+ 'Type' = 'AsymmetricX509Cert'
137
+ }
138
+ New-AzADAppCredential -ObjectId $ObjectId -KeyCredentials $Credential -CustomKeyIdentifier $CertificateThumbprint
136
139
```
137
140
138
- Create key credentials for application with object Id $Id
141
+ ### Example 2: Create password credentials for an application
139
142
140
- ### Example 2: Create password credentials for application
141
143
``` powershell
142
- # ApplicationId is AppId of Application object which is different from directory id in Azure AD.
143
- Get-AzADApplication -ApplicationId $appId | New-AzADAppCredential -StartDate $startDate -EndDate $endDate
144
+ # $ApplicationId` should be the the 'Application ID' GUID associated with the Azure app registration.
145
+ $ApplicationId = "00000000-0000-0000-0000-000000000000"
146
+ Get-AzADApplication -ApplicationId $ApplicationId | New-AzADAppCredential -StartDate $startDate -EndDate $endDate
144
147
```
145
148
146
- Create password credentials for application
147
149
148
150
## PARAMETERS
149
151
0 commit comments