Microsoft Entra 앱을 등록할 여러 API에 대한 액세스 권한을 부여합니다. 요구 사항이 변경되면 해당 권한을 조정해야 할 수 있습니다. 이 문서에서 그 방법을 보여줍니다.
참고 항목
Microsoft Entra 앱 권한은 다음과 같은 경우에만 적용됩니다.
-
조직에 포함
- '마스터 사용자' 인증 방법을 사용하여 '고객에 포함'
Microsoft Entra 앱에서 권한 설정 편집
프로그래밍 방식으로 또는 Azure Portal에서 사용 권한을 변경할 수 있습니다.
Azure Portal에서 앱을 보고 사용 권한을 변경할 수 있습니다.
Azure Portal에 로그인합니다.
페이지의 오른쪽 위에서 사용자 계정을 선택하여 Microsoft Entra 테넌트를 선택합니다.
앱 등록을 선택합니다. 이 옵션이 표시되지 않는 경우 검색합니다.
소유한 애플리케이션 탭에서 앱을 선택합니다. 애플리케이션은 ‘개요’ 탭에서 열리며, 여기서 ‘애플리케이션 ID’를 검토할 수 있습니다.
API 사용 권한 보기 탭을 선택합니다.
권한 추가를 선택합니다.
권한을 추가하려면 다음 단계를 수행합니다(GCC 앱의 경우 첫 번째 단계가 다름).
Microsoft API 탭에서 Power BI 서비스를 선택합니다.
참고 항목
GCC 앱의 경우 내 조직에서 사용하는 API 탭을 선택하고 Microsoft Power BI 정부 커뮤니티 클라우드 또는 fc4979e5-0aa5-429f-b13a-5d1365be5566을 검색합니다.
위임된 권한을 선택하고 필요한 특정 권한을 추가 또는 제거합니다.
완료되면 사용 권한 추가를 선택하여 변경 내용을 저장합니다.
사용 권한을 제거하려면 다음 단계를 수행합니다.
사용 권한 오른쪽에 있는 줄임표(...)를 선택합니다.
권한 제거를 선택합니다.
‘권한 제거’ 팝업 창에서 예, 제거합니다를 선택합니다.
프로그래밍 방식으로 Microsoft Entra 앱 사용 권한을 변경하려면 테넌트 내에서 기존 서비스 주체(사용자)를 가져와야 합니다. 이 작업을 수행하는 방법에 대한 자세한 내용은 servicePrincipal을 참조하세요.
테넌트 내에서 모든 서비스 주체를 가져오려면 Get servicePrincipal 없이 {ID} API를 호출합니다.
속성으로 앱 ‘애플리케이션 ID’가 있는 서비스 주체를 확인합니다.appId (displayName은 선택 사항입니다.)
Post https://graph.microsoft.com/v1.0/servicePrincipals HTTP/1.1
Authorization: Bearer ey..qw
Content-Type: application/json
{
"accountEnabled" : true,
"appId" : "{App_Client_ID}",
"displayName" : "{App_DisplayName}"
}
consentType에 다음 값 중 하나를 할당하여 앱에 대한 Power BI 사용 권한을 부여합니다.
Post https://graph.microsoft.com/v1.0/OAuth2PermissionGrants HTTP/1.1
Authorization: Bearer ey..qw
Content-Type: application/json
{
"clientId":"{Service_Plan_ID}",
"consentType":"AllPrincipals",
"resourceId":"a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1",
"scope":"Dataset.ReadWrite.All Dashboard.Read.All Report.Read.All Group.Read Group.Read.All Content.Create Metadata.View_Any Dataset.Read.All Data.Alter_Any",
"expiryTime":"2018-03-29T14:35:32.4943409+03:00",
"startTime":"2017-03-29T14:35:32.4933413+03:00"
}
참고 항목
-
마스터 사용자를 사용하는 경우 Microsoft Entra ID에서 동의 여부를 묻는 메시지가 표시되지 않게 하려면 마스터 계정에 대한 사용 권한을 부여해야 합니다.
- 테
resourceId 넌트에 따라 다르며 범용적이지 않습니다. 해당 값은 Microsoft Entra ID에 있는 Power BI 서비스 애플리케이션의 objectId입니다. Azure Portal에서 이 값을 얻으려면 엔터프라이즈 애플리케이션 > 모든 애플리케이션으로 이동하여 Power BI 서비스를 검색합니다.
consentType에 값을 할당하여 Microsoft Entra ID에 앱 사용 권한을 부여합니다.
Post https://graph.microsoft.com/v1.0/OAuth2PermissionGrants HTTP/1.1
Authorization: Bearer ey..qw
Content-Type: application/json
{
"clientId":"{Service_Plan_ID}",
"consentType":"AllPrincipals",
"resourceId":"a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1",
"scope":"User.Read Directory.AccessAsUser.All",
"expiryTime":"2018-03-29T14:35:32.4943409+03:00",
"startTime":"2017-03-29T14:35:32.4933413+03:00"
}
C#을 사용하여 Microsoft Entra 앱 사용 권한을 변경할 수도 있습니다. 자세한 내용은 oAuth2PermissionGrant API를 참조하세요. 이 방법은 일부 프로세스를 자동화하려는 경우에 유용할 수 있습니다.
var graphClient = GetGraphClient();
currentState.createdApp = await graphClient.Applications
.Request()
.AddAsync(application);
System.Threading.Thread.Sleep(2000);
var passwordCredential = new PasswordCredential
{
DisplayName = "Client Secret Created in C#"
};
currentState.createdSecret = await graphClient.Applications[currentState.createdApp.Id]
.AddPassword(passwordCredential)
.Request()
.PostAsync();
var servicePrincipal = new ServicePrincipal
{
AppId = currentState.createdApp.AppId
};
currentState.createdServicePrincipal = await graphClient.ServicePrincipals
.Request()
.AddAsync(servicePrincipal);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
// Use oAuth2PermissionGrant to change permissions
var oAuth2PermissionGrant = await graphClient.Oauth2PermissionGrants["{id}"]
.Request()
.GetAsync();
관련 콘텐츠