You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The state the remote object should be refreshed and updated correctly so that the inner resources can behave accordingly.
Here, we have separate lifecycle for the creation of azdo project and azuredevops_resource_authorization. Although the creation of project could have been done via the UI, obtaining the project id is't straight forward.
# this file is in .\projectvariable"org_name" {}
terraform {
required_providers {
azuredevops={
source ="microsoft/azuredevops"
version =">=0.1.0"
}
}
}
provider"azuredevops" {
org_service_url="https://dev.azure.com/${var.org_name}/"
}
resource"azuredevops_project""blah" {
name="blah"
}
output"id" {
value=azuredevops_project.blah.id
}
# this file is in .\service-endpointvariable"org_name" {} # same as the org abovevariable"project_id" {} # retrieved from above projectterraform {
required_providers {
azuredevops={
source ="microsoft/azuredevops"
version =">=0.1.0"
}
}
}
provider"azuredevops" {
org_service_url="https://dev.azure.com/${var.org_name}/"
}
resource"azuredevops_serviceendpoint_azurerm""endpointazure" {
project_id="d04c1da4-d718-4f36-888c-72e4d0fa5149"# retrieved from above projectservice_endpoint_name="Sample AzureRM"description="Managed by Terraform"credentials {
serviceprincipalid="00000000-0000-0000-0000-000000000000"serviceprincipalkey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
azurerm_spn_tenantid="00000000-0000-0000-0000-000000000000"azurerm_subscription_id="00000000-0000-0000-0000-000000000000"azurerm_subscription_name="Sample Subscription"
}
resource"azuredevops_resource_authorization""name" {
project_id=var.project_idresource_id=azuredevops_serviceendpoint_azurerm.endpointazure.idauthorized=true
}
Debug Output
Panic Output
Expected Behavior
Expected: detect azdo project to have been destroyed for azuredevops_serviceendpoint_azurerm & azuredevops_resource_authorization and to be remove related child resources.
Actual Behavior
Error: VS800075: The project with id 'd04c1da4-d718-4f36-888c-72e4d0fa5149' does not exist, or you do not have permission to access it.
Steps to Reproduce
cd ./project and terraform apply to create azdo project
cd ./service-endpoint and terraform apply
cd back to ./project and terraform destroy to destroy azdo project
Currently, all resource won't handle the project status, if the project resource been deleted, the sub resource will simply throw an error. All resources depends on project should handle the project status.
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform v1.0.8
azurerm v2.78.0
azuredevops v0.1.7
azuredevops_resource_authorization
Terraform Configuration Files
The state the remote object should be refreshed and updated correctly so that the inner resources can behave accordingly.
Here, we have separate lifecycle for the creation of azdo
project
andazuredevops_resource_authorization
. Although the creation of project could have been done via the UI, obtaining the project id is't straight forward.Debug Output
Panic Output
Expected Behavior
Expected: detect azdo project to have been destroyed for
azuredevops_serviceendpoint_azurerm
&azuredevops_resource_authorization
and to be remove related child resources.Actual Behavior
Error: VS800075: The project with id 'd04c1da4-d718-4f36-888c-72e4d0fa5149' does not exist, or you do not have permission to access it.
Steps to Reproduce
cd
./project andterraform apply
to create azdo projectcd
./service-endpoint andterraform apply
cd
back to ./project andterraform destroy
to destroy azdo projectcd
back to ./service-endpoint andterraform plan
Important Factoids
References
I suspect that this line of code is returning the error - https://github.com/microsoft/terraform-provider-azuredevops/blob/main/azuredevops/internal/service/build/resource_resource_authorization.go#L119
Perhaps another check to determine if the project is missing should be added, and if so, set the id to "".
The text was updated successfully, but these errors were encountered: