Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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

  • MichaelFP Profile Picture
    1,833 Super User 2025 Season 1 on at
    Every time we are trying to deploy this to from Power Platform DEV to QA or PROD Env.
    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1