Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[solution-import] add more descriptive error message when a solution environment variable is missing #249

Open
henricson opened this issue Oct 20, 2022 · 1 comment

Comments

@henricson
Copy link

henricson commented Oct 20, 2022

Hi,

I had an issue where my unmanaged solution import failed with the very undescriptive message "Error: The given key was not present in the dictionary.".

After a lot of testing, I think I have isolated the error to be related to not having defined a deployment setting file, containing the required environment variable for my solution.

Here is my step-config; adding the last two lines resolved the error:

 - name: Import solution as unmanaged to build env
        uses: microsoft/powerplatform-actions/import-solution@v0
        with:
          environment-url: ${{inputs.BUILD_ENVIRONMENT_URL}}
          app-id: ${{inputs.CLIENT_ID}}
          client-secret: ${{ secrets.envSecret }}
          tenant-id: ${{inputs.TENANT_ID}}
          solution-file: ${{ inputs.solution_outbound_folder}}/${{ inputs.solution_name }}.zip
          force-overwrite: true
          publish-changes: true
          run-asynchronously: true
          use-deployment-settings-file: true
          deployment-settings-file: "env.json"

It took me some time to isolate the cause of this error, and I think it would be great to include a more descriptive error message.

The origin of the error message seems to be the target environment itself, so I guess an immediate fix would to be to add some client-side validations on the solution-import action, checking the contents environmentvariabledefinition.xml.

@henricson henricson changed the title [solution-import] add concrete error message when an environment variable is missing [solution-import] add more descriptive error message when an environment variable is missing Oct 20, 2022
@henricson henricson changed the title [solution-import] add more descriptive error message when an environment variable is missing [solution-import] add more descriptive error message when an solution environment variable is missing Oct 20, 2022
@henricson henricson changed the title [solution-import] add more descriptive error message when an solution environment variable is missing [solution-import] add more descriptive error message when a solution environment variable is missing Oct 20, 2022
@henricson
Copy link
Author

henricson commented Oct 20, 2022

Some additional information: it seems that the issue only occurs when importing an unmanaged solution. In my latter steps, while doing an import of a managed version of this solution, I was able to import without providing environment variables. These were, as expected, requested in the web-ui on make.powerapps.com after the successful first import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant