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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Every time we are tryi...
Power Apps
Unanswered

Every time we are trying to deploy this to from Power Platform DEV to QA or PROD Env.

(1) ShareShare
ReportReport
Posted on by 2

Every time we are trying to deploy this to from Power Platform DEV to QA or PROD Env. we are having this issue with Unique Key constraint. We created the New Env. Variable to see if that Fixed this issue but it's caused the same error when we tried to redeploy the same solution again to same env. 

 


ImportAsHolding failed with exception :Cannot insert duplicate key exception when executing non-query: System.Data.SqlClient.SqlCommand Exception: System.Data.SqlClient.SqlException (0x80131904): Violation of UNIQUE KEY constraint 'ndx_envvarval_schemaname'. Cannot insert duplicate key in object 'dbo.EnvironmentVariableValueBase'. The duplicate key value is (kpapps_HuntAppsSPSite, 0, Jan 1 1900 12:00AM). The statement has been terminated. at Microsoft.Crm.CrmDbConnection.HandleExecutionExceptionAbstract(Exception exception, String commandText, IDbConnection connection, IDbCommand command, IDbTransaction transaction, Boolean isOpen, Int32 commandTimeout, IConnectionRetryPolicy localRetryPolicy, Int32& retryCount) at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetryAbstract[TResult](Func`1 executeMethod, IDbCommand command, IConnectionRetryPolicy retryPolicy) at Microsoft.Crm.CrmDbConnection.<>c__DisplayClass238_0.<InternalExecuteNonQuery>b__0() at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties) at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func) at Microsoft.Crm.Platform.Server.DataEngine.SqlDataAccessManager.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context, Int32 sourceLineNumber, String memberName, String sourceFilePath) at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQueryAbstract(IDbCommand command, ISqlExecutionContext context) at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQueryAbstract(IDbCommand command, ExecutionContext context) at Microsoft.Crm.Platform.SolutionAwareComponents.UpdateExecutor.ExecuteUpdate(IDbCommand command, ExecutionContext context) ClientConnectionId:e687fdbb-73a9-405f-a647-b6b8c8286675 Error Number:2627,State:1,Class:14 ClientConnectionId before routing:5fd30a73-5508-4c0b-8bcc-1caa8cda2005 Routing Destination:afc8000ee888.tr9517.westus1-a.worker.database.windows.net,11018

Screenshot 2024-08-29 110444.png
I have the same question (0)
  • MichaelFP Profile Picture
    2,001 Moderator on at
    did you check if your environment variable in the QA and PROD is not unmanaged? I had similar issue when one of the developers has created manually the env variable and after we tried to send with the same schema name in the solution. 
     
    Can you share to us the solutions layers.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard