microsoft / powerplatform-build-tools

Power Platform Build Tools 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
198 stars 40 forks source link

Azure DevOps Pipeline PowerPages Fails #1025

Open Leuret opened 2 months ago

Leuret commented 2 months ago

Describe the bug Last few days our PowerPages pipeline has started failing. It is giving the following error: Error: Power Pages entities for standard data model (v1) aren't available on this org, please install required packages on this org. If you are trying to upload to enhanced data model (v2), pass model version as "2". For more information see https://learn.microsoft.com/en-us/power-pages/admin/enhanced-data-model#data-model-power-platform-cli-parameters .

It's a V1 portal. The pipeline was working properly before. Logs.txt

To Reproduce Steps to reproduce the behavior:

  1. Run a DevOps pipeline job that deploys portals. It will fail with the error message: Error: Power Pages entities for standard data model (v1) aren't available on this org, please install required packages on this org. If you are trying to upload to enhanced data model (v2), pass model version as "2". For more information see https://learn.microsoft.com/en-us/power-pages/admin/enhanced-data-model#data-model-power-platform-cli-parameters .

Expected behavior The portal to deploy to downstream environments.

devonuto commented 2 months ago

Having same issue using

# Upload Portal https://learn.microsoft.com/en-us/power-platform/alm/devops-build-tool-tasks#yaml-snippet-upload-paportal
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.upload-paportal.PowerPlatformUploadPaportal@2
  displayName: 'Upload Portal to ${{ parameters.environmentName }}'
  inputs:
    authenticationType: 'PowerPlatformSPN'
    PowerPlatformSPN: ${{ parameters.ppSpn }}
    UploadPath: '${{ parameters.stagingPath }}'
    DeploymentProfile: '${{ parameters.environmentName }}'
    Environment: '${{ parameters.environmentURL }}'
sebgauthier commented 2 months ago

I can confirm this broke with version 1.34.3 of the CLI 1.33.5 works as expected.

polks71 commented 2 months ago

This broke in our environment as well. Worked on August 21st but is breaking now today.

From the devops log:

Task : Power Platform Upload PAPortal Description : Power Platform Upload PowerPages web site (PAPortal) Version : 2.0.77 Author : Microsoft Help : https://aka.ms/buildtoolsdoc Ideas, feedback: https://github.com/microsoft/powerplatform-build-tools/discussions .... [ 'Started uploading website data' ] [ 'Connected to... TruNorth' ] [ 'Microsoft PowerPlatform CLI' ] [ 'Version: 1.34.4+gbc3320d' ]

devonuto commented 2 months ago

Has anyone managed to find a workaround? Possible to specify a specific version of the build tools?

sebgauthier commented 2 months ago

I’ve reverted back to deploying locally. Not ideal but it works.

devonuto commented 2 months ago

Unfortunately our client does not allow that, so we're stuck until a fix is deployed.

ManuLeaN commented 2 months ago

Just to draw more attention to the problem... we also have this exact problem.

Ingogogo commented 2 months ago

Hello, we have the same problem:

        "Started uploading website data
        Connected to... xxx
        Microsoft PowerPlatform CLI
        Version: 1.34.4+gbc3320d
        Online documentation: https://aka.ms/PowerPlatformCLI
        Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

        Error: **Power Pages entities for standard data model (v1) aren't available on this org, please install required packages on this org. If you are trying to upload to enhanced data model (v2), pass model version as "2"**. For more information see https://learn.microsoft.com/en-us/power-pages/admin/enhanced-data-model#data-model-power-platform-cli-parameters ."

It worked perfectly fine three weeks ago but when we start our pipeline now this error occours. We didn't change anything on our site. We checked the origin system and the target system and both are v1 and all entites are present.

nick626262 commented 2 months ago

Failing for me on two environments but working on a different one. I guess the environments are subtlety different but it was working on both before.

WretchedDade commented 2 months ago

I was having this issue as well and have worked around it by switching to a PowerShell task in ADO temporarily so that I can specify the CLI version. I run commands like the following:

dotnet tool install --global Microsoft.PowerApps.CLI.Tool --version 1.33.5

pac auth create -mi -env XXX

pac pages upload --path XXX --deploymentProfile XXX --modelVersion 1
sebgauthier commented 2 months ago

I was having this issue as well and have worked around it by switching to a PowerShell task in ADO temporarily so that I can specify the CLI version. I run commands like the following:

dotnet tool install --global Microsoft.PowerApps.CLI.Tool --version 1.33.5

pac auth create -mi -env XXX

pac pages upload --path XXX --deploymentProfile XXX --modelVersion 1

To build on this, if you need to authenticate using a service connection I use this task to extract the connection info

    - task: PowerPlatformSetConnectionVariables@2
      name: conn
      inputs:
        authenticationType: 'PowerPlatformSPN'
        PowerPlatformSPN: 'service-connection-name-here'

Then you can extract the appId, secret and tenant like so

pac auth create --name UAT-SPN --applicationId $(conn.BuildTools.ApplicationId) --clientSecret $(conn.BuildTools.ClientSecret) --tenant $(conn.BuildTools.TenantId)
ManuLeaN commented 2 months ago

I was having this issue as well and have worked around it by switching to a PowerShell task in ADO temporarily so that I can specify the CLI version. I run commands like the following:

dotnet tool install --global Microsoft.PowerApps.CLI.Tool --version 1.33.5

pac auth create -mi -env XXX

pac pages upload --path XXX --deploymentProfile XXX --modelVersion 1

To build on this, if you need to authenticate using a service connection I use this task to extract the connection info

    - task: PowerPlatformSetConnectionVariables@2
      name: conn
      inputs:
        authenticationType: 'PowerPlatformSPN'
        PowerPlatformSPN: 'service-connection-name-here'

Then you can extract the appId, secret and tenant like so

pac auth create --name UAT-SPN --applicationId $(conn.BuildTools.ApplicationId) --clientSecret $(conn.BuildTools.ClientSecret) --tenant $(conn.BuildTools.TenantId)

Hey Thanks, that seems to work perfectly on my local machine but for some reason in a pipeline i get the error "Sorry, the app encountered a non recoverable error and will need to terminate." any ideas on how to fix that?

MickytHogFather commented 1 month ago

We had exactly the same problem, in our azure pipeline we were running the "Latest Version" of the CLI and thats where the issue hit! I copied in the version you were running @ManuLeaN on your local and it started magicly working!

Image