microsoft / microsoft/powerplatform-actions
[solution-import] add more descriptive error message when a solution environment variable is missing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 301
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the solution-import action and trace how deployment settings and environmentvariabledefinition.xml are handled during import. Confirm the missing-environment-variable failure path and define a descriptive client-side error; done means the action reports which required setting is missing instead of the dictionary error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100