microsoft / azure-devops-go-api

This repository contains Go APIs for interacting with and managing Azure DevOps.
https://docs.microsoft.com/en-us/azure/devops/integrate/index?view=azure-devops
MIT License
186 stars 78 forks source link

[Feature Request] Include Security Role Assignment #148

Open xuzhang3 opened 7 months ago

xuzhang3 commented 7 months ago

Support mange Security Role Assignment API: https://learn.microsoft.com/en-us/rest/api/azure/devops/securityroles/roleassignments/set-role-assignment?view=azure-devops-rest-7.0

favoretti commented 6 months ago

@xuzhang3 is there any idea when this can be generated in the SDK? I could use some resources in azuredevops as well, but can't make those until this is generated. Thank you!

favoretti commented 6 months ago

Or well, I assume I could potentially inline a client into the provider, but that's dirty :)

favoretti commented 6 months ago

Here's a working stub of both client and a couple of resources implementation. https://github.com/microsoft/terraform-provider-azuredevops/pull/982/files

Example usage is:

data "azuredevops_securityrole_definitions" "test" {
  scope = "distributedtask.environmentreferencerole"
}

resource "azuredevops_securityrole_assignment" "test" {
  scope       = "distributedtask.environmentreferencerole"
  resource_id = "xxxx-xxxx-4b83-8b07-2f80221212f1_1624"
  identity_id = "8f436a3e-xxxx-4ae8-xxxx-f1383f8848ca"
  role_name   = "Administrator"
}