recreate if build definition not found
@@ -11,6 +11,7 @@ import (
"github.com/microsoft/azure-devops-go-api/azuredevops/v6/build"
"github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/client"
securityhelper "github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/permissions/utils"
+ "github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/utils"
"github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/utils/converter"
)
@@ -57,6 +58,10 @@ func resourceBuildDefinitionPermissionsRead(d *schema.ResourceData, m interface{
sn, err := securityhelper.NewSecurityNamespace(d, clients, securityhelper.SecurityNamespaceIDValues.Build, createBuildToken)
if err != nil {
+ if utils.ResponseWasNotFound(err) {
+ d.SetId("")
+ return nil
+ }
return err
}
