Terraform是否支持在Azure CLI中执行类似的操作?
az role assignment create --assignee ${var.assignee} --role Reader --scope /subscriptions/${var.subscription_id}/resourceGroups/${var.registry_name}/providers/Microsoft.ContainerRegistry/registries/${var.registry_name}
目前我正在使用Terraform
做这样的事情provisioner "local-exec" {
command = "az login --service-principal -u ${var.client_id} -p ${var.client_secret} --tenant ${var.tenant_id}"
}
provisioner "local-exec" {
command = "az role assignment create --assignee ${var.assignee} --role Reader --scope /subscriptions/${var.subscription_id}/resourceGroups/${var.registry_name}/providers/Microsoft.ContainerRegistry/registries/${var.registry_name}"
}
答案 0 :(得分:0)