관리 ID를 사용하여 넷 프레임 워크 앱에서 Azure 앱 구성으로 연결하려고하는데 권한 문제가 있습니다.
연결 방법
options.Connect(new Uri("https://myconfigstore.azconfig.io"), new ManagedIdentityCredential(clientId));
포털을 사용하여 찾을 수있는 다양한 clientId, objectids 및 applicationId guid를 모두 시도했지만 언제 guid를 호출하더라도 항상 잘못된 요청을 받고 있습니다.
Azure.Identity.CredentialUnavailableException: 'ManagedIdentityCredential authentication unavailable,
the requested identity has not been assigned to this resource.
Status: 400 (Bad Request)
clientId를 지정하지 않고 ManagedIdentityCredential을 생성하면이 오류가 발생합니다.
Azure.RequestFailedException: 'Service request failed.
Status: 403 (Forbidden)
내 ID 관리 Azure 앱 구성 데이터 권한을 부여했습니다.
이것이 내가 사용해야하는 clientId입니까?
최신 정보:
내 활성 디렉토리 (AAD-> 속성)의 ID를 사용하려고했는데
Azure.RequestFailedException: 'Service request failed.
Status: 403 (Forbidden)
That can only mean that I am using the wrong id because otherwise it should have returned 400 (Bad Request) like in the other error I see.
Full code
private static async Task Main()
{
var builder = new ConfigurationBuilder();
const string clientId = "e589d9f1-xxxx-xxxx-xxxx-6bc940d50ab7";
builder.AddAzureAppConfiguration(options =>
{
options.Connect(new Uri("https://myconfigstore.azconfig.io"), new ManagedIdentityCredential(clientId));
});
_configuration = builder.Build();
Console.WriteLine("Number of keys: " + _configuration.GetChildren().Count());
Console.WriteLine("Demo: " + _configuration["Demo"]);
}
This document demonstrates how to use managed identity to access App Configuration from App Service, but you can replace the App Service with any other Azure services that support managed identity. https://docs.microsoft.com/en-us/azure/azure-app-configuration/howto-integrate-azure-managed-service-identity
Here are a few things I'd like to call out
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다