Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Suggested answer

Error in PowerApps Export Solution task

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I am creating a build pipeline for PowerApps Source Control, in my private organization (for POC purpose)

I am following the documents available at http://aka.ms/ppalmlab.

When I run the pipeline it fails at the PowerApps Export Solution task. 

 

Error

2020-03-09T13:00:50.9395643Z ##[error]Failed to connect to instance: https://org9d4ca161.crm.dynamics.com/. Please verify your credentials for *** and instance url.
ERROR REQUESTING Token FROM THE Authentication context
ERROR REQUESTING Token FROM THE Authentication contextOne or more errors occurred. => AADSTS50034: The user account {EmailHidden} does not exist in the ------------------------------- directory. To sign into this application, the account must be added to the directory.
Timestamp: 2020-03-09 13:00:50Z => Response status code does not indicate success: 400 (BadRequest). => {"error":"invalid_grant","error_description":"AADSTS50034: The user account {EmailHidden} does not exist in the ------------------------- directory. To sign into this application, the account must be added to the directory.\r\n

.

.

Unknown errorUnable to connect to CRM: AADSTS50034: The user account {EmailHidden} does not exist in the 72f988bf-86f1-41af-91ab-2d7cd011db47 directory. To sign into this application, the account must be added to the directory.
.
.
Unable to Login to Dynamics CRM
2020-03-09T13:00:50.9756159Z ##[section]Finishing: PowerApps Export Solution

 

Any solution/suggestion on this, Kindly let me know where I am going wrong.

  • Suggested answer
    SushilV Profile Picture
    2 on at
    Error in PowerApps Export Solution task
    Error in PowerApps Export Solution task  The reason given was: The given solution unique name (powerapp_demo) is not valid
     
    Answering this question so that anyone facing this error in future gets help in this thread.
     
    Above error occurs mostly when you specify solution name pipeline task/command which does not match the solution name in environment.
     
    Verify the solution name in command or pipeline task. By mistake any leading or trailing whitespaces or any special character got added.
  • ryanspain Profile Picture
    100 on at
    Re: Error in PowerApps Export Solution task

    Hi @PanneerS,

     

    I can see from the logs that you are connected to an environment named 'Trial Environment'.

     

    Assuming this is the environment you intend to connect to, is your service connection in Azure DevOps using credentials for a user/app that has access to this environment?

     

    Additionally, could you copy a screenshot of the solution unique name? You can verify it exists in your environment via the maker portal or using the below OData query in your browser.

    https://<YOUR_TRIAL_ENV_UNIQUE_NAME>.crmX.dynamics.com/api/data/v9.2/solutions?$filter=uniquename%20eq%20%27powerapp_demo%27

    Replace <YOUR_TRIAL_ENV_UNIQUE_NAME> and the X for the region you are in.

  • PanneerS Profile Picture
    2 on at
    Re: Error in PowerApps Export Solution task

    @ryanspain I am trying to export a solution using Power Platform Export solution in azure devops but it was throwing an error, The given unique name was not valid. 

    Both SolutionName in PowerApps and DevOps are same.

    Extensions used: Power Platform Build Tools (2.0.10)

     

    Error: 

    [ 'Calling pac cli inputs: solution export --name powerapp_demo --path D:\\a\\1\\a\\powerapp_demo_Unmanaged.zip --overwrite true --managed false --async true --max-async-wait-time 120 --include autonumbering,calendar,customization,emailtracking,general,isvconfig,marketing,outlooksynchronization,relationshiproles,sales' ]
    ##[debug]command: D:\a\_tasks\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\2.0.10\bin\pac\tools\pac.exe, first arg of 16: solution
    [ 'Connected to...Trial Environment' ]
    [ '' ]
    [ 'Starting Solution Export...' ]
    [ '' ]
    [ 'Waiting for asynchronous operation f172c289-996c-ed11-81ac-002248d5d430 to complete with timeout of 02:00:00' ]
    [ '' ]
    [ 'Processing asynchronous operation... execution time: 00:00:00 and 0.00% complete' ]
    [ '' ]
    [ 'Processing asynchronous operation... execution time: 00:00:04 and 0.06% complete' ]
    [ '' ]
    [ 'Asynchronous operation f172c289-996c-ed11-81ac-002248d5d430 failed within 00:00:09.0338225.' ]
    [ '' ]
    [ 'The reason given was: The given solution unique name (powerapp_demo) is not valid' ]
    [ 'Microsoft PowerPlatform CLI' ]
    [ 'Version: 1.20.3+ga66a744' ]
    [ '' ]
    [ 'Error: The async operation completed with a statuscode of Failed.' ]
     
    Could you please assist on this.
  • ryanspain Profile Picture
    100 on at
    Re: Error in PowerApps Export Solution task

    Delayed response here but to respond to your question below:

    "Does the URL varies depending on the region?"

    Yes - see short mapping of the regions below linking each region to a sample URL.

    • North America => crm => contoso.crm.dynamics.com
    • South America => crm1 => contoso.crm1.dynamics.com
    • Europe, Middle East, Africa => crm4 => contoso.crm4.dynamics.com

    Often I see training/sample material refer to the North America alias - you just need check it.

  • ryanspain Profile Picture
    100 on at
    Re: Error in PowerApps Export Solution task

    Hey @sneha123,

     

    I completed this lab some time ago and though it is a little outdated, I was able to get a working example running.

     

    I recommend confirming the below:

     

    DevOps Service Connection

    When you add your service connection in Azure DevOps, confirm that the user logon is correct. i.e.

    • This should be the a System Administrator or similar user - obviously they must be licensed.
    • Have you tried using a new user? Confirm you can sign in and export solutions with that user in the maker portal.
    • The organization portion of the logon URL should be correct. Note this different from your environment name (orge334c2f1)
    • Ensure you check the box to Allow all pipelines to use this connection
    • I assume your Azure DevOps organisation is in the same tenant as your CDS environment 

    image.png

     

    Power Apps Tools Installer

    This task should be added before any other build tools tasks. Typically it is the first task in the agent, as below. Make sure it is.

    image.png

     

     

     

     

     

    PowerApps Build Tools version

    What version of the build tools are you using? 

    image.png

     

    Edit: Additional Question

    What are you using an Application Registration for? 

     

    My suggestions come in the absence of any more formal recomendations from the team. 

     

    Hope it helps in some way.

    Ryan

  • sneha123 Profile Picture
    Microsoft Employee on at
    Re: Error in PowerApps Export Solution task

    Hi,

     

    Do we have any solution for this error, I am still stuck over here. 

    I am creating this pipeline in a project, in my local organization. 

    Also providing the (my email)username and password in the generic service connection, which I use in the PowerApps Environment URL in the Export task.

     

    I have also registered 'https://orge334c2f1.crm.dynamics.com/'the link in app registrations.

     

    Please let me know if I am missing anything. 

     

    Thanks 

    -Sneha

     

     

     

  • sneha123 Profile Picture
    Microsoft Employee on at
    Re: Error in PowerApps Export Solution task

    Hi @JisungHan 

     

    The user have access on the instance https://org9d4ca161.crm.dynamics.com also the user have administrator rights to Export the solution.

  • sneha123 Profile Picture
    Microsoft Employee on at
    Re: Error in PowerApps Export Solution task

    Hi @ryanspain,

     

    Yes that is the URL for the environment, but I didn't get you when you say 'region specified using the '.crmX' portion of the URL.'

    Does the URL varies depending on the region?

    And user exists in AAD for the tenant

     

  • JisungHan Profile Picture
    on at
    Re: Error in PowerApps Export Solution task

    Hi @sneha123,

     

    1. Please check whether the processing user is in the instance: https://org9d4ca161.crm.dynamics.com/

    2. Check whether the user has administrator right to export the Solution task

     

    After checking this, please let us know the result.

     

  • ryanspain Profile Picture
    100 on at
    Re: Error in PowerApps Export Solution task
    Hi @sneha123,

    Have you confirmed that is the correct URL for your environment? i.e. is the correct region specified using the '.crmX' portion of the URL.

    Have you confirmed that the User or Application Registration exists in Azure AD for that tenant? The error states it does not which may make it plausible that you are pointing at the incorrect tenant.

    Ryan

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399