Skip to content

Commit 502ef62

Browse files
Merge pull request #17661 from sethmanheim/grph-scrpt
Update Graph API retirement script
2 parents 1db8d00 + 0fcfd4a commit 502ef62

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

azure-stack/operator/graph-api-retirement.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to mitigate the retirement of the Entra ID Graph API.
44
author: sethmanheim
55
ms.author: sethm
66
ms.topic: conceptual
7-
ms.date: 03/14/2025
7+
ms.date: 04/15/2025
88
ms.reviewer: rtiberiu
99

1010
---
@@ -39,11 +39,14 @@ $ErrorActionPreference='Stop'
3939
Import-Module Microsoft.Graph.Authentication
4040
Import-Module Microsoft.Graph.Applications
4141
42+
# Target your Azure Cloud instance name; use Get-MgEnvironment to list available clouds and Add-MgEnvironment to add new ones as needed for custom private/secure clouds
43+
$envName = 'Global'
44+
4245
# Repeat this flow for each of your target directory tenants
4346
$tenantId = 'MyTenantId'
44-
47+
4548
# Sign in with admin permissions to read and write all application objects
46-
Connect-MgGraph -TenantId $tenantId -Scopes Application.ReadWrite.All
49+
Connect-MgGraph -Environment $envName -TenantId $tenantId -Scopes Application.ReadWrite.All
4750
4851
# Retrieve all applications in the current directory
4952
Write-Host "Looking-up all applications in directory '$tenantId'..."
@@ -128,6 +131,20 @@ Found '1' total Azure Stack deployments in directory '<ID>>'
128131
Found '0' total Azure Stack applications which need permission to continue calling Legacy Microsoft Graph Service
129132
```
130133

134+
The following output from the `Get-MgEnvironment` command shows the default cloud instances that are included when you install the Graph module:
135+
136+
```output
137+
C:\> Get-MgEnvironment
138+
139+
Name AzureADEndpoint GraphEndpoint Type
140+
---- --------------- ------------- ----
141+
USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us Built-in
142+
Germany https://login.microsoftonline.de https://graph.microsoft.de Built-in
143+
USGov https://login.microsoftonline.us https://graph.microsoft.us Built-in
144+
China https://login.chinacloudapi.cn https://microsoftgraph.chinacloudapi.cn Built-in
145+
Global https://login.microsoftonline.com https://graph.microsoft.com Built-in
146+
```
147+
131148
## Next steps
132149

133150
[Azure Stack Hub release notes](release-notes.md)

0 commit comments

Comments
 (0)