다음을 통해 공유


관리 ID 사용

Azure Communication Services는 개발자가 애플리케이션에 실시간 통신 기능을 빌드할 수 있는 완전 관리형 통신 플랫폼입니다. Azure Communication Services에서 관리 ID를 사용하면 애플리케이션에 대한 인증 프로세스를 간소화하는 동시에 보안을 높일 수 있습니다. 이 문서에서는 Azure Communication Services에서 관리 ID를 사용하는 방법을 설명합니다.

Azure Communication Services에서 관리 ID 사용

Azure Communication Services는 관리 ID를 사용하여 서비스를 인증하도록 지원합니다. 관리 ID를 사용하면 사용자 고유의 액세스 토큰 및 자격 증명을 관리할 필요가 없습니다.

Azure Communication Services 리소스에는 다음 두 가지 유형의 ID가 할당될 수 있습니다.

  1. 리소스에 연결되고 리소스가 삭제될 때 삭제되는 시스템 할당 ID 입니다. 리소스에는 시스템 할당 ID가 하나만 있을 수 있습니다.
  2. Azure Communication Services 리소스에 할당할 수 있는 Azure 리소스인 사용자 할당 ID입니다. 이 ID는 리소스가 삭제될 때 삭제되지 않습니다. 리소스에는 여러 사용자 할당 ID가 있을 수 있습니다.

Azure Communication Services에서 관리 ID를 사용하려면 다음 단계를 수행합니다.

  1. 관리 ID에 Communication Services 리소스에 대한 액세스 권한을 부여합니다. 이 할당은 Azure Portal, Azure CLI 및 Azure Communication Management SDK를 통해 수행할 수 있습니다.
  2. 관리 ID를 사용하여 Azure Communication Services로 인증합니다. 인증은 관리 ID를 지원하는 Azure SDK 또는 REST API를 통해 수행할 수 있습니다.

시스템 할당 ID 추가

  1. 앱 페이지의 왼쪽 탐색 창에서 설정 그룹으로 아래로 스크롤합니다.

  2. ID를 선택합니다.

  3. 시스템 할당 탭에서 상태를 켜기로 전환합니다. 저장을 선택합니다. 시스템 할당 관리 ID를 사용하도록 설정하는 방법을 보여 주는 스크린샷

사용자 할당 ID 추가

Azure Communication Services 리소스에 사용자 할당 ID를 할당하려면 먼저 ID를 만든 다음 해당 리소스 식별자를 Communication Service 리소스에 추가해야 합니다.

먼저 사용자 할당 관리 ID 리소스를 만들어야 합니다.

  1. 이러한 지침에 따라 사용자 할당 관리 ID 리소스를 만듭니다.

  2. 앱 페이지의 왼쪽 탐색 영역에서 설정 그룹으로 아래로 스크롤합니다.

  3. ID를 선택합니다.

  4. 사용자 할당>추가를 선택합니다.

  5. 이전에 만든 ID를 검색하고 선택하고 추가를 선택합니다. 사용자가 할당한 관리 ID를 사용하도록 설정하는 방법을 보여 주는 스크린샷

Azure Communication Services 관리 SDK를 사용한 관리 ID

Azure Communication Management SDK를 사용하여 Azure Communication Services 리소스에 관리 ID를 할당할 수도 있습니다.

생성 시 또는 리소스를 업데이트할 때 리소스 정의에 ID 속성을 도입하여 이 할당을 수행할 수 있습니다.

Azure Communication Management SDK for .NET을 사용하여 Azure Communication Services 리소스에 관리 ID를 할당하려면 IdentityCommunicationServiceResourceData 속성을 설정할 수 있습니다.

다음은 그 예입니다.

public async Task CreateResourceWithSystemAssignedManagedIdentity()
{
    ArmClient armClient = new ArmClient(new DefaultAzureCredential());
    SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();

    //Create Resource group
    ResourceGroupCollection rgCollection = subscription.GetResourceGroups();
    // With the collection, we can create a new resource group with an specific name
    string rgName = "myRgName";
    AzureLocation ___location = AzureLocation.WestUS2;
    ArmOperation<ResourceGroupResource> lro = await rgCollection.CreateOrUpdateAsync(WaitUntil.Completed, rgName, new ResourceGroupData(___location));
    ResourceGroupResource resourceGroup = lro.Value;

    // get resource group collection
    CommunicationServiceResourceCollection collection = resourceGroup.GetCommunicationServiceResources();
    string communicationServiceName = "myCommunicationService";
    
    // Create Communication Service Resource
    var identity = new ManagedServiceIdentity(ManagedServiceIdentityType.SystemAssigned);
    CommunicationServiceResourceData data = new CommunicationServiceResourceData("global")
    {
        DataLocation = "UnitedStates",
        Identity = identity
    };
    var communicationServiceLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, communicationServiceName, data);
    var resource = communicationServiceLro.Value;
}

.NET Management SDK 사용에 대한 자세한 내용은 .NET용 Azure Communication Management SDK를 참조하세요.

리소스 인스턴스 관리에 대한 자세한 내용은 Communication Service 리소스 인스턴스 관리를 참조하세요.

비고

리소스는 시스템 할당 ID와 사용자 할당 ID를 동시에 가질 수 있습니다. 이 경우 속성은 . type 입니다 SystemAssigned,UserAssigned.

리소스에서 모든 관리 ID 할당을 제거하려면 type 속성을 None로 지정하십시오.

다음 단계