我是否在azuread.tf中错误地分配了下面的应用程序角色权限?
resource "azuread_application" "resource_creation" {
display_name = local.azad_resource_creation_sp_name
app_role {
# ensuring app role definition can be assigned to other applications (the service principal)
allowed_member_types = ["Application"]
# enabling the app role
enabled = true
# app role description used when the role is being assigned
description = "Pre Requisite application role for service principal authentication"
# app role display name that shows during app role assignment
display_name = "Role assigned - Application.ReadWrite.All"
# unique identifier of the app role, sourced from https://learn.microsoft.com/en-us/graph/permissions-reference
id = "1bfefb4e-e0b5-418b-a88f-73c46d2cc8e9"
}
}
应用配置后,我将收到以下错误:
Error: Could not create application
with azuread_application.service_connection
on azuread.tf line 14, in resource "azuread_application" "service_connection":
resource "azuread_application" "service_connection" {
ApplicationsClient.BaseClient.Post(): unexpected status 403 with OData error: Authorization_RequestDenied: Insufficient privileges to complete the operation.
我引用了其他代码示例,在这个例子中,我通过一个服务主体进行创作。因此,我分配了:Application.ReadWrite.All
角色。来源于这里- Microsoft图形权限引用
我需要app角色分配吗?或者除了Application.ReadWrite.All
角色之外,还需要额外的应用程序角色吗?
发布于 2022-11-04 14:52:03
看起来,通过代码403的查找和错误类型,我会说这是您的Azure帐户角色中的一个错误,您试图通过它来管理和部署terraform资源。因此,只需检查用户的服务角色,要么位于“应用程序管理员”中,要么位于"Application“ApplicationsClient.BaseClient.Post():意外状态403中,其中包含OData错误: Authorization_RequestDenied:不足以完成操作。
发布于 2022-11-04 15:15:10
因为你要通过服务校长登录,
必须在Azure administrator中指定“应用程序管理员”或“应用程序开发人员”的角色给此服务负责人
希望这能有所帮助!
https://stackoverflow.com/questions/74315814
复制相似问题