次の方法で共有


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 への継続的なアクセスが必要なアプリケーションがある場合、スクリプトはこれらのアプリケーションを拡張機能用に構成するフラグを設定し、これらの特定のアプリケーションが 2025 年 6 月まで引き続き従来の 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 によって、ホーム ディレクトリ (Azure Stack Hub のメイン ID プロバイダー) として使用される 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
 
# 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 -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 in the current directory
$deploymentGuids = $applications.IdentifierUris |
    Where-Object { $_ -like 'https://management.*' -or $_ -like 'https://adminmanagement.*' } |
    ForEach-Object { "$_".Split('/')[3] } |
    Select-Object -Unique
Write-Host "Found '$($deploymentGuids.Count)' total Azure Stack deployments in directory '$tenantId'"
 
# Find all the Azure Stack application objects for each deployment
$azureStackApplications = @()
foreach ($application in $applications)
{
    foreach ($deploymentGuid in $deploymentGuids)
    {
        if (($application.IdentifierUris -join '') -like "*$deploymentGuid*")
        {
            $azureStackApplications += $application
        }
    }
}
 
# Find which Azure Stack applications require access to Legacy Graph Service
$azureStackLegacyGraphApplications = $azureStackApplications |
    Where-Object { $_.RequiredResourceAccess.ResourceAppId -contains '00000002-0000-0000-c000-000000000000' }
 
# Find which of those applications need to have their authentication behaviors patched to allow access to Legacy Graph
$azureStackLegacyGraphApplicationsToUpdate = $azureStackLegacyGraphApplications |
    Where-Object { -not ($ab = $_.AdditionalProperties.authenticationBehaviors) -or -not $ab.ContainsKey(($key='blockAzureADGraphAccess')) -or $ab[$key] }
 
# Update the applications which 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 

次のステップ

Azure Stack Hub のリリース ノート