次の方法で共有


Microsoft Entra ID Graph API の廃止

Microsoft Entra ID (旧称 Azure Active Directory または Azure AD) Graph API サービス は廃止されます。 この廃止は、Microsoft Entra ID プラットフォームを合理化し、Microsoft Entra ID 開発者エクスペリエンスを向上させるための広範な取り組みの一環です。

軽減ステップを実行する

Graph API の提供終了は、ID プロバイダーとして Entra ID を使用するすべての Azure Stack Hub のお客様に影響を与え、影響を受けるすべてのアプリケーションについて、この記事に含まれるスクリプトを実行する必要があります。 Graph API への継続的なアクセスが必要なアプリケーションがある場合、スクリプトは、これらの特定のアプリケーションが従来の Graph API の呼び出しを続行できるようにする拡張機能用にこれらのアプリケーションを構成するフラグを設定します。

この記事で提供される PowerShell スクリプトでは、Azure Stack Hub の各 Entra ID ID プロバイダーに対して Graph API 拡張機能を構成するためのフラグを各アプリケーションに設定します。

ID プロバイダーとして Entra ID を使用する Azure Stack Hub 環境が引き続き機能するようにするには、2025 年 2 月末までにこのスクリプトを実行する必要があります。

メモ

2025 年 2 月以降にこのフラグの追加を遅らせると、認証は失敗します。 その後、このスクリプトを実行して、必要に応じて Azure Stack Hub が機能することを確認できます。

スクリプトを実行する

ホーム ディレクトリ (Azure Stack Hub のメイン ID プロバイダー) として Azure Stack Hub によって使用される Entra ID 環境と、Azure Stack Hub システムを登録した Entra ID 環境で、次の PowerShell スクリプトを実行します。 これは、ホーム ディレクトリとは異なるディレクトリである可能性があります。 スクリプトは Azure と対話するため、特定のコンピューターで実行する必要はありません。 ただし、スクリプトを実行するには、それぞれの Entra ID テナントに少なくともアプリケーション管理者特権が必要です。

ローカル コンピューターで管理者特権を使用して、次のスクリプトを実行してください。

# Install the Graph modules if necessary
#Install-Module Microsoft.Graph.Authentication
#Install-Module Microsoft.Graph.Applications
 
$ErrorActionPreference='Stop'
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Applications
 
# 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
$envName = 'Global'

# Repeat this flow for each of your target directory tenants
$tenantId = 'MyTenantId'

# Sign in with admin permissions to read and write all application objects
Connect-MgGraph -Environment $envName -TenantId $tenantId -Scopes Application.ReadWrite.All
 
# Retrieve all applications in the current directory
Write-Host "Looking-up all applications in directory '$tenantId'..."
$applications = Get-MgApplication -All -Property id, displayName, appId, identifierUris, requiredResourceAccess, authenticationBehaviors
Write-Host "Found '$($applications.Count)' total applications in directory '$tenantId'"
 
# Find all the unique deployment GUIDs, each one representing an Azure Stack deployment or registration in the current directory
$deploymentGuids = $applications.IdentifierUris |
    Where-Object { $_ -like 'https://management.*' -or $_ -like 'https://adminmanagement.*' -or $_ -like 'https://azurebridge*' } |
    ForEach-Object { "$_".Split('/')[3] } |
    Select-Object -Unique
Write-Host "Found '$($deploymentGuids.Count)' total Azure Stack deployments or registrations in directory '$tenantId'"
 
# Find all the Azure Stack application objects for each deployment or registration
$azureStackApplications = @()
foreach ($application in $applications)
{
    foreach ($deploymentGuid in $deploymentGuids)
    {
        if (($application.IdentifierUris -join '') -like "*$deploymentGuid*")
        {
            $azureStackApplications += $application
            break
        }
    }
}
 
# Find which Azure Stack applications require access to the legacy Graph Service
$azureStackLegacyGraphApplications = $azureStackApplications |
    Where-Object {
        ($_.RequiredResourceAccess.ResourceAppId -contains '00000002-0000-0000-c000-000000000000') -or
        ($_.IdentifierUris | Where-Object { $_ -like 'https://azurebridge*' }) }
 
# Find which of those applications need to have their authentication behaviors patched to allow access to legacy Graph
$azureStackLegacyGraphApplicationsToUpdate = $azureStackLegacyGraphApplications | Where-Object {
    $oldLocationSet = $false -eq $_.AdditionalProperties.authenticationBehaviors.blockAzureADGraphAccess
    $newLocationNotSet = $false -eq $_.AuthenticationBehaviors.BlockAzureAdGraphAccess
    return (-not $oldLocationSet -and -not $newLocationNotSet)
}
 
# Update the applications that require their authentication behaviors patched to allow access to legacy Graph
Write-Host "Found '$($azureStackLegacyGraphApplicationsToUpdate.Count)' total Azure Stack applications which need permission to continue calling Legacy Microsoft Graph Service"
$count = 0
foreach ($application in $azureStackLegacyGraphApplicationsToUpdate)
{
    $count++
    Write-Host "$count/$($azureStackLegacyGraphApplicationsToUpdate.Count) - Updating application '$($application.DisplayName)' (appId=$($application.AppId)) (id=$($application.Id))"
    Update-MgApplication -ApplicationId $application.Id -BodyParameter @{
        authenticationBehaviors = @{ blockAzureADGraphAccess = $false }
    }
}

このスクリプトには、次のサンプル出力が表示されます。

Looking-up all applications in directory '<ID>'... 
Found '###' total applications in directory '<ID>'
Found '1' total Azure Stack deployments in directory '<app ID>'
Found '16' total Azure Stack applications which need permission to continue calling Legacy Microsoft Graph Service
1/16 - Updating application 'Azure Stack - AKS' (appId=<app ID>) (id=<ID>)
2/16 - Updating application 'Azure Stack - Hubs' (appId=<app ID>) (id=<ID>)
3/16 - Updating application 'Azure Stack - Portal Administration' (appId=<app ID>) (id=<app>)
4/16 - Updating application 'Azure Stack - RBAC Administration' (appId=<app ID>) (id=ID)
5/16 - Updating application 'Azure Stack - Container Registry' (appId=<app ID>) (id=ID)
6/16 - Updating application 'Azure Stack - RBAC' (appId=<app ID>) (id=ID)
7/16 - Updating application 'Azure Stack - Hubs Administration' (appId=<app ID>) (id=ID)
8/16 - Updating application 'Azure Stack - Deployment Provider' (appId=<app ID>) (id=ID)
9/16 - Updating application 'Azure Stack - Deployment' (appId=<app ID>) (id=ID)
10/16 - Updating application 'Azure Stack - KeyVault' (appId=<app ID>) (id=ID)
11/16 - Updating application 'Azure Stack' (appId=<app ID>) (id=ID)
12/16 - Updating application 'Azure Stack - Administration' (appId=<app ID>) (id=ID)
13/16 - Updating application 'Azure Stack - Policy Administration' (appId=<app ID>) (id=ID)
14/16 - Updating application 'Azure Stack - Policy' (appId=<app ID>) (id=ID)
15/16 - Updating application 'Azure Stack - Portal' (appId=<app ID>) (id=ID)
16/16 - Updating application 'Azure Stack - KeyVault Administration ' (appId=<app ID>) (id=ID) 

スクリプトをもう一度実行して、すべてのアプリケーションが更新されたことを確認します。 すべてのアプリケーションが正常に更新された場合、スクリプトは次の出力を返す必要があります。

Looking-up all applications in directory '<ID>'...
Found '####' total applications in directory '<ID>>'
Found '1' total Azure Stack deployments in directory '<ID>>'
Found '0' total Azure Stack applications which need permission to continue calling Legacy Microsoft Graph Service 

Get-MgEnvironment コマンドからの次の出力は、Graph モジュールのインストール時に含まれる既定のクラウド インスタンスを示しています。

C:\> Get-MgEnvironment

Name     AzureADEndpoint                   GraphEndpoint                           Type    
----     ---------------                   -------------                           ----    
USGovDoD https://login.microsoftonline.us  https://dod-graph.microsoft.us          Built-in
Germany  https://login.microsoftonline.de  https://graph.microsoft.de              Built-in
USGov    https://login.microsoftonline.us  https://graph.microsoft.us              Built-in
China    https://login.chinacloudapi.cn    https://microsoftgraph.chinacloudapi.cn Built-in
Global   https://login.microsoftonline.com https://graph.microsoft.com             Built-in

次のステップ

Azure Stack Hub のリリース ノート