Skip to content

Commit 20900f9

Browse files
authored
Merge pull request #111411 from SaurabhSharma-MSFT/patch-70
(AzureCXP) Fix for GitHub Issue 52393
2 parents 75cec60 + 61d968e commit 20900f9

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

articles/active-directory/reports-monitoring/tutorial-access-api-with-certificates.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ In this tutorial, you learn how to use a test certificate to access the MS Graph
4242
- Access tokens from user, application keys, and certificates using ADAL
4343
- Graph API handling paged results
4444

45-
6. If it's your first time using the module run **Install-MSCloudIdUtilsModule**, otherwise import it using the **Import-Module** Powershell command. Your session should look similar to this screen:
46-
![Windows Powershell](./media/tutorial-access-api-with-certificates/module-install.png)
45+
6. If it's your first time using the module run **Install-MSCloudIdUtilsModule**, otherwise import it using the **Import-Module** PowerShell command. Your session should look similar to this screen:
46+
![Windows PowerShell](./media/tutorial-access-api-with-certificates/module-install.png)
4747

48-
7. Use the **New-SelfSignedCertificate** Powershell commandlet to create a test certificate.
48+
7. Use the **New-SelfSignedCertificate** PowerShell commandlet to create a test certificate.
4949

5050
```
5151
$cert = New-SelfSignedCertificate -Subject "CN=MSGraph_ReportingAPI" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256
@@ -62,13 +62,13 @@ In this tutorial, you learn how to use a test certificate to access the MS Graph
6262

6363
1. Navigate to the [Azure portal](https://portal.azure.com), select **Azure Active Directory**, then select **App registrations** and choose your application from the list.
6464

65-
2. Select **Settings** > **Keys** and select **Upload Public Key**.
65+
2. Select **Certificates & secrets** under **Manage** section on Application registration blade and select **Upload Certificate**.
6666

67-
3. Select the certificate file from the previous step and select **Save**.
67+
3. Select the certificate file from the previous step and select **Add**.
6868

69-
4. Note the Application ID, and the thumbprint of the certificate you just registered with your application. To find the thumbprint, from your application page in the portal, go to **Settings** and click **Keys**. The thumbprint will be under the **Public Keys** list.
69+
4. Note the Application ID, and the thumbprint of the certificate you just registered with your application. To find the thumbprint, from your application page in the portal, go to **Certificates & secrets** under **Manage** section. The thumbprint will be under the **Certificates** list.
7070

71-
5. Open the application manifest in the inline manifest editor and replace the *keyCredentials* property with your new certificate information using the following schema.
71+
5. Open the application manifest in the inline manifest editor and verify the *keyCredentials* property is updated with your new certificate information as shown below -
7272

7373
```
7474
"keyCredentials": [
@@ -80,23 +80,20 @@ In this tutorial, you learn how to use a test certificate to access the MS Graph
8080
"value": "$base64Value" //base64 encoding of the certificate raw data
8181
}
8282
]
83-
```
84-
85-
6. Save the manifest.
86-
87-
7. Now, you can get an access token for the MS Graph API using this certificate. Use the **Get-MSCloudIdMSGraphAccessTokenFromCert** cmdlet from the MSCloudIdUtils PowerShell module, passing in the Application ID and the thumbprint you obtained from the previous step.
83+
```
84+
6. Now, you can get an access token for the MS Graph API using this certificate. Use the **Get-MSCloudIdMSGraphAccessTokenFromCert** cmdlet from the MSCloudIdUtils PowerShell module, passing in the Application ID and the thumbprint you obtained from the previous step.
8885

8986
![Azure portal](./media/tutorial-access-api-with-certificates/getaccesstoken.png)
9087

91-
8. Use the access token in your Powershell script to query the Graph API. Use the **Invoke-MSCloudIdMSGraphQuery** cmdlet from the MSCloudIDUtils to enumerate the signins and directoryAudits endpoint. This cmdlet handles multi-paged results, and sends those results to the PowerShell pipeline.
88+
7. Use the access token in your PowerShell script to query the Graph API. Use the **Invoke-MSCloudIdMSGraphQuery** cmdlet from the MSCloudIDUtils to enumerate the signins and directoryAudits endpoint. This cmdlet handles multi-paged results, and sends those results to the PowerShell pipeline.
9289

93-
9. Query the directoryAudits endpoint to retrieve the audit logs.
90+
8. Query the directoryAudits endpoint to retrieve the audit logs.
9491
![Azure portal](./media/tutorial-access-api-with-certificates/query-directoryAudits.png)
9592

96-
10. Query the signins endpoint to retrieve the sign-in logs.
93+
9. Query the signins endpoint to retrieve the sign-in logs.
9794
![Azure portal](./media/tutorial-access-api-with-certificates/query-signins.png)
9895

99-
11. You can now choose to export this data to a CSV and save to a SIEM system. You can also wrap your script in a scheduled task to get Azure AD data from your tenant periodically without having to store application keys in the source code.
96+
10. You can now choose to export this data to a CSV and save to a SIEM system. You can also wrap your script in a scheduled task to get Azure AD data from your tenant periodically without having to store application keys in the source code.
10097

10198
## Next steps
10299

0 commit comments

Comments
 (0)