web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Pipeline fails after d...
Power Apps
Unanswered

Pipeline fails after deleting an environment variable

(0) ShareShare
ReportReport
Posted on by 54

I have a solution with two apps, one flow and an environment variable. Have been using the Power Platform Pipelines for a while now and they have (mostly) worked fine. Now I deleted an environment variable and added a new one - and the pipeline now fails. I get this error:

 

Solution Upgrade action failed after import as holding. InnerException is: Sql error: Statement conflicted with a constraint. 
The DELETE statement conflicted with the REFERENCE constraint "environmentvariabledefinition_environmentvariablevalue". The
conflict occurred in database "db_crmcoreemea_20230815_09382405_f241", table "dbo.EnvironmentVariableValueBase", column
'EnvironmentVariableDefinitionId'.
The statement has been terminated. CRM ErrorCode: -2147185375 Sql ErrorCode: -2146232060 Sql Number: 547.

 

I did not change anything else, so it must be the deleting of environment variable that broke things. I don't fancy the idea of deleting the solution from my target environment and creating it again, as that would mean doing all sharing again - and I don't think the pipeline should break this easily to begin with.

 

Anything else I might try, that wouldn't break the apps in my target environment (people are using them -> can't just test things and hope it works)?

I have the same question (0)
  • Parvez Ghumra Profile Picture
    1,579 Moderator on at

    @AnttiKurenniemi When you created the new Environment Variable, did you create it with the same logical name as the one you had deleted?

     

    Maybe one thing to try to would be delete the Environment Variable you have just created and then retry. This will confirm whether it's the deletion of the previous Environment Variable that's caused the problem or the creation of the new one

  • AnttiKurenniemi Profile Picture
    54 on at

    No, it has a completely different name. But I'll try what you suggested - I'm just worried about breaking the target environment, the app that has been deployed there earlier is working and in use, I wouldn't want it to break by fiddling... 

  • Parvez Ghumra Profile Picture
    1,579 Moderator on at

    @AnttiKurenniemi Take a back-up of the target environment just before attempting to do the deployment if that helps alleviate your concerns, enabling you to restore the target environment from this back-up in the future if need be

  • Rogier_Duurkoop Profile Picture
    8 on at

    Possible solution:
    I got the same error. I also had removed Environment Variables.
    Recreated the removed Environment Variable(s) , with the same name (you can get it from the Managed Solution). And after that it seemed that there was a dependency in that Environment Variable, it was the value. I deleted the Value via the Default Solution (it was not available in the Solution itself). Then removed the Environment Variable again from the Solution and after that I was able to successfully deploy the solution. 

  • jimmyall4 Profile Picture
    8 on at

    Did you ever find a solution for this? I am facing the same issue when deploying to my test environment and can not delete my old solution from that environment without getting this same error either.  

  • Rogier_Duurkoop Profile Picture
    8 on at

    Yes, just follow my solution above

  • jimmyall4 Profile Picture
    8 on at

    I recreated my environment variables in the default solution of my target environment that the partial deployment happened. Unfortunately, I am still getting the same error on the uninstall. Can you walk through how you determined that the dependency issue on the value was the cause. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 408

#2
WarrenBelz Profile Picture

WarrenBelz 382 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 328 Super User 2025 Season 2

Last 30 days Overall leaderboard