microsoft / powerplatform-actions

Power Platform GitHub Actions automate common build and deployment tasks related to Power Platform. This includes synchronization of solution metadata (a.k.a. solutions) between development environments and source control, generating build artifacts, deploying to downstream environments, provisioning/de-provisioning of environments, and the ability to perform static analysis checks against your solution using the PowerApps checker service.
MIT License
221 stars 68 forks source link

spawn Unknown error when running synced offline power platform actions in UsGovDoD cloud #445

Closed DevonAleshireMSFT closed 1 year ago

DevonAleshireMSFT commented 1 year ago

I am getting an error when running synced offline power platform actions on GitHub Enterprise server in US Gov DoD cloud.

I originally tested the power platform actions in an IL4-GCCH environment and was successful. After testing in IL4 I wanted to test in IL5-DoD tenant.

*IL5 tenant uses GitHub Enterprise server and requires manually syncing actions.

Steps

  1. Manually Synced the power-platform-actions using action-sync tool to enterprise server.
  2. Followed basic tutorial for automating solution deployment

I have double checked the yaml file syntax and service principal settings / secret. When executing from IL5 I did have to update the cloud to UsGovDod. Looking to determine if this is an issue on my side our the code behind when communicating with DoD cloud.

Error image

Debug image

Workflow


name: export-and-branch-solution
# Export solution from DEV environment
#  unpack it and prepare, commit and push a git branch with the changes

on:
  workflow_dispatch:
    inputs:
      # Change this value
      solution_name:
        description: 'name of the solution to worked on from Power Platform'
        required: true
        default: ALMDemoSolution
       #Do Not change these values
      solution_exported_folder:
        description: 'folder name for staging the exported solution *do not change*'
        required: true
        default: out/exported/
      solution_folder:
        description: 'staging the unpacked solution folder before check-in *do not change*'
        required: true
        default: out/solutions/
      solution_target_folder: 
       description: 'folder name to be created and checked in *do not change*'
       required: true
       default: solutions/
env:
#edit your values here
  ENVIRONMENT_URL: '<URL>'
  CLIENT_ID: '<Client Id>'
  TENANT_ID: '<Tenant Id>'
permissions:
  contents: write
jobs:
  export-from-dev:
    runs-on: [<Runner Tag>]
    env:
      RUNNER_DEBUG: 1

    steps:
    - uses: actions/checkout@v2
      with:
        lfs: true

    - name: who-am-i action
      uses: <synced repo>/powerplatform-actions/who-am-i@v0
      with:
        environment-url: ${{env.ENVIRONMENT_URL}}
        app-id: ${{env.CLIENT_ID}}
        client-secret: ${{ secrets.PowerPlatformSPN }}
        tenant-id: ${{env.TENANT_ID}}
        cloud: UsGovDod

    - name: export-solution action
      uses: <synced repo>/powerplatform-actions/export-solution@v0
      with:
        environment-url: ${{env.ENVIRONMENT_URL}}
        app-id: ${{env.CLIENT_ID}}
        client-secret: ${{ secrets.PowerPlatformSPN }}
        tenant-id: ${{env.TENANT_ID}}
        solution-name: ${{ github.event.inputs.solution_name }}
        solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip
        cloud: UsGovDod

    - name: unpack-solution action
      uses: <synced repo>/powerplatform-actions/unpack-solution@v0
      with:
        solution-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip
        solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }}
        solution-type: 'Unmanaged'
        overwrite-files: true

    - name: branch-solution, prepare it for a PullRequest
      uses: <synced repo>/powerplatform-actions/branch-solution@v0
      with:
        solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }}
        solution-target-folder: ${{ github.event.inputs.solution_target_folder}}/${{ github.event.inputs.solution_name }}
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        allow-empty-commit: true```
DevonAleshireMSFT commented 1 year ago

Running with latest, it advises PAC needs to be installed on runner. Thinking this might be the issue... ?

image

petrochuk commented 1 year ago

We documented changes for v1 actions: https://learn.microsoft.com/en-us/power-platform/alm/devops-github-available-actions#helper-tasks

DevonAleshireMSFT commented 1 year ago

Perfect! Updating the jobs to v1 and adding the install Power Platform tools task has corrected the issue. Thank you @petrochuk