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 / 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

I have the same question (0)
  • MichaelFP Profile Picture
    1,847 Super User 2025 Season 2 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

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
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard