-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission Error for azuredevops_pipeline_authorization type endpoint #1117
Comments
@FRUCHTiii Cannot reproduce this error. The could be the permission issue or the resource not exist, if I set "resource_id" with a dummy value I get the same error |
Thank you for your reply and help. I try to replace the old, deprected, resource with the new. My Terraform plan looks like this # module.cd-test.module.sonarqube[0].azuredevops_pipeline_authorization.sonarqube_auth will be created
+ resource "azuredevops_pipeline_authorization" "sonarqube_auth" {
+ id = (known after apply)
+ project_id = "eecb6be9-f80a-4c8d-XXXX-0d356db27bc2"
+ resource_id = "61e9a1e4-c366-4cbd-8d03-2dc329f0e9a5"
+ type = "endpoint"
}
# module.cd-test.module.sonarqube[0].azuredevops_resource_authorization.sonarqube_auth will be destroyed
# (because azuredevops_resource_authorization.sonarqube_auth is not in configuration)
- resource "azuredevops_resource_authorization" "sonarqube_auth" {
- authorized = true -> null
- definition_id = 0 -> null
- id = "61e9a1e4-c366-4cbd-8d03-2dc329f0e9a5" -> null
- project_id = "eecb6be9-f80a-4c8d-XXXX-0d356db27bc2" -> null
- resource_id = "61e9a1e4-c366-4cbd-8d03-2dc329f0e9a5" -> null
- type = "endpoint" -> null
} As you can see the resource_id is exactly the same and is set correct. As the old resource is working fine. Thats how I set up both resources. resource "azuredevops_resource_authorization" "sonarqube_auth" {
project_id = data.azuredevops_project.delivery.id
resource_id = azuredevops_serviceendpoint_sonarqube.sonarqube.id
authorized = true
}
resource "azuredevops_pipeline_authorization" "sonarqube_auth" {
project_id = data.azuredevops_project.delivery.id
resource_id = azuredevops_serviceendpoint_sonarqube.sonarqube.id
type = "endpoint"
} I'm not able to see my issue over here. |
@FRUCHTiii I tried the PAT token with limited permission and still works for me. Don't know how the token generated in your environment, if the resource exist this could be the token permission issue. The token does not have right permission. In addition, the old deprecated resource
|
@FRUCHTiii Just come to my mind that the authorization API will get all authorizations, including other pipeline authorizations. This may be the root cause. |
@xuzhang3 I think I'm not really getting you're answer. |
@FRUCHTiii I mean, there are other pipes that are granted but PAT does not have the access permission |
@xuzhang3 I gave this problem another try today. When I'm adding the UMI to the Project Collection Administrators on the Organization Level then I'm able to use the new resource and roll-out the changes. As soon as I'm remove this and the UMI is "only" Project Administrators on the Project Level I'm unable to use this resource. So from my perspective this looks like the api is doing things in the background that aren't supoosed to and this whole thing feels like a bug to me. To add all UMI to Project Collection Administrators on the Organization Level is a completly No-Go to me and feels like a security issue. |
I've fixed my issue #923 (comment) by adding Endpoint Administrator permission to the service account that was running terraform. |
@@xuzhang3 tried version 1.4 and still get the same error.
I have no Idea to get this fixed or what the next steps could be to find the issue. |
@FRUCHTiii Weird . I just need to add the identity/SPN to the |
Within our code we try to replace the
azuredevops_resource_authorization
withazuredevops_pipeline_authorization
.On both we want to enable open access on our service connections.
With the old resource the authorization works as expected if we try to get to the new resource it is broken.
The User with runs terraform has admin permissions on the service connection and also created the service connection so I'm quite sure that this isn't a permission error.
Is there anything I can do to use the new resource?
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform: v1.9.3
Azure DevOps Provider: v1.2.0
Affected Resource(s)
azuredevops_pipeline_authorization
Terraform Configuration Files
Expected Behavior
The Provider should set the settings for the service connection to open access
Actual Behavior
We get the following Error:
The text was updated successfully, but these errors were encountered: