我正在使用 Terraform 在 Azure 中创建应用注册。
之后,我尝试将所有者权限授予其他人(我自己),但它不允许我这样做。
我正在使用的命令序列是:
resource "azurerm_azuread_application" "service_principal" {
name = "${var.departamentoCamel}-${var.appnameCamel}-${var.entorno}"
homepage = "https://${lower("${var.appnameCamel}")}.asisa.es"
available_to_other_tenants = false
oauth2_allow_implicit_flow = true
}
resource "azurerm_azuread_service_principal" "service_principal" {
application_id = "${azurerm_azuread_application.service_principal.application_id}"
}
resource "azurerm_azuread_service_principal_password" "service_principal" {
service_principal_id = "${azurerm_azuread_service_principal.service_principal.id}"
value = "${random_string.password.result}="
end_date = "2020-01-01T01:02:03Z"
}
resource "azurerm_role_assignment" "test" {
scope = "${azurerm_azuread_application.service_principal.id}"
role_definition_name = "Owner"
principal_id = "8c7b71b3-cf32-4da5-9bbb-5e5dd249c607"
}
但我收到以下错误消息:
* azurerm_role_assignment.test: authorization.RoleAssignmentsClient#Create: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="MissingSubscription" Message="The request did not have a provided subscription. All requests must have an associated subscription Id."
有谁知道如何将所有者角色赋予 ObjectID 8c7b71b3-cf32-4da5-9bbb-5e5dd249c607 的人?
谢谢,胡安拉