terraform-provider-azuread icon indicating copy to clipboard operation
terraform-provider-azuread copied to clipboard

Added support for assigning licenses to a user or group

Open alagae opened this issue 3 years ago • 3 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritise the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Added support for assigning licenses to a user or group

New or Affected Resource(s)

  • azuread_group
  • azuread_user

Potential Terraform Configuration

resource "azuread_user" "example" {
  user_principal_name = "[email protected]"
  display_name        = "J. Doe"
  mail_nickname       = "jdoe"
  password            = "SecretP@sswd99!"
  usage_location      = "GB"

  licenses = {
    disabledPlans = [
      "113feb6c-3fe4-4440-bddc-54d774bf0318",
      "14ab5db5-e6c4-4b20-b4bc-13e36fd2227f",
    ]
    sku = "b05e124f-c7cc-45a0-a6aa-8cf78c946968"
  }

  licenses = {
    disabledPlans = [
      "a413a9ff-720c-4822-98ef-2f37c2a21f4c"
    ]
    sku = "c7df2760-2c81-4ef7-b578-5b5392b571df"
  }
}

resource "azuread_group" "example" {
  display_name     = "example"
  security_enabled = true

  licenses = {
    disabledPlans = [
      "113feb6c-3fe4-4440-bddc-54d774bf0318",
      "14ab5db5-e6c4-4b20-b4bc-13e36fd2227f",
    ]
    sku = "b05e124f-c7cc-45a0-a6aa-8cf78c946968"
  }

  licenses = {
    disabledPlans = [
      "a413a9ff-720c-4822-98ef-2f37c2a21f4c"
    ]
    sku = "c7df2760-2c81-4ef7-b578-5b5392b571df"
  }
}

References

Microsoft Graph

https://docs.microsoft.com/en-us/graph/api/user-assignlicense?view=graph-rest-1.0&tabs=http

https://docs.microsoft.com/en-us/graph/api/group-assignlicense?view=graph-rest-1.0&tabs=http

SKU and Service Plan GUIDs

https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference)

alagae avatar Feb 24 '22 15:02 alagae

+1

ruhomor avatar Aug 17 '22 09:08 ruhomor

Any update on this? This would be VERY useful!

breisig avatar Mar 09 '24 16:03 breisig

I eagerly await the day this becomes available!

kyoyar avatar Mar 21 '24 09:03 kyoyar