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
200 stars 41 forks source link

Power Platform Export Solution command does not provide a parameter that allows for overwriting the solution file. #197

Closed shawnbeeson closed 2 years ago

shawnbeeson commented 2 years ago

WE had created a pipeline that users the PowerPlatform "Export" task to export a specific solution and store it in source control. Since the update to the @2 version, our pipeline "broke" when attempting to export the solution because it cannot overwrite the local solution file on the file system (cloned on the Build Agent from source control earlier in the pipeline).

There does not appear to be a parameter in the pipeline task that corresponds with the -overwrite flag in the underlying CLI command.

I was forced to rollback to the @0 version of the Power Platform Tools due to this issue.

Starting: PowerPlatformExportSolution

Task : Power Platform Export Solution Description : Power Platform Export Solution Version : 2.0.5 Author : Microsoft Help : More Info

[debug]authenticationType=PowerPlatformEnvironment

[debug]PowerPlatformEnvironment=f7ba5070-20b5-47df-a1ad-cb61bcbb43a7

[debug]f7ba5070-20b5-47df-a1ad-cb61bcbb43a7=https://mpegla-test.crm.dynamics.com/

Falling back to url from service connection, using: https://mpegla-test.crm.dynamics.com/

[debug]Falling back to url from service connection, using: https://mpegla-test.crm.dynamics.com/

[debug]POWERPLATFORMTOOLS_PACCLIPATH=D:\a_tasks\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\2.0.5\bin

[ 'authN to env: authType=UserPass; cloudInstance: Public; envUrl: https://mpegla-test.crm.dynamics.com/' ]

[debug]command: D:\a_tasks\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\2.0.5\bin\pac\tools\pac.exe, first arg of 10: auth

[ '\'\' authenticated successfully.' ] [ 'Validating connection...' ] [ 'Connected to...MPEGLA-TEST' ] [ 'Authentication profile created' ] [ ' DATAVERSE https://mpegla-test.crm.dynamics.com/ : ** Public' ] [ '' ] [ 'The Authentication Result: \'\' authenticated successfully.,Validating connection...,Connected to...MPEGLA-TEST,Authentication profile created, * DATAVERSE https://mpegla-test.crm.dynamics.com/ : *** Public,' ]

[ 'Calling pac cli inputs: solution export --name MPEGLAEnvironmentVariables --path D:\a\1\s\Solutions\MPEGLAEnvironmentVariables_unmanaged.zip --managed false --async true --max-async-wait-time 180' ]

[debug]command: D:\a_tasks\PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3\2.0.5\bin\pac\tools\pac.exe, first arg of 12: solution

[ 'Microsoft PowerPlatform CLI' ] [ 'Version: 1.17.6+g3fe18a3' ] [ '' ] [ 'Error: Solution output file D:\a\1\s\Solutions\MPEGLAEnvironmentVariables_unmanaged.zip already exists.' ] [ '' ] [ 'Usage: pac solution export --path --name [--managed] [--include] [--async] [--max-async-wait-time] [--overwrite] [--targetversion]' ] [ '' ] [ ' --path Path where the exported solution zip file will be written (alias: -p)' ] [ ' --name The name of the solution to be exported (alias: -n)' ] [ ' --managed Whether the solution should be exported as a managed solution (alias: -m)' ] [ ' --include Which settings should be included in the solution being exported (alias: -i)' ] [ ' Values: autonumbering, calendar, customization, emailtracking, externalapplications, general, isvconfig, marketing, outlooksynchronization, relationshiproles, sales' ] [ ' --async Exports solution asynchronously (alias: -a)' ] [ ' --max-async-wait-time Max asynchronous wait time in minutes. Default value is 60 minutes (alias: -wt)' ] [ ' --overwrite The exported solution file can overwrite the solution zip file on the local file system. (alias: -ow)' ] [ ' --targetversion (deprecated) The version that the exported solution will support (alias: -v)' ] [ '' ]

[error]error: 1

[debug]Processed: ##vso[task.issue type=error;]error: 1

[error]failed: Microsoft PowerPlatform CLI

davidjenni commented 2 years ago

dupe to #168 shipped in latest PP-BT 2.0.7, see: https://marketplace.visualstudio.com/items?itemName=microsoft-IsvExpTools.PowerPlatform-BuildTools

shawnbeeson commented 2 years ago

Within Azure DevOps > Manage Extensions, the version has been upgraded to 2.0.7. However, I reverted my pipelines to use @2 and they are still using 2.0.5 when running the PowerPlatform Tools Installer step.

Is there a way to force the pipeline to pull the latest version?

On Thu, Sep 15, 2022 at 2:23 PM David JENNI @.***> wrote:

dupe to #168 https://github.com/microsoft/powerplatform-build-tools/issues/168 shipped in latest PP-BT 2.0.7, see: https://marketplace.visualstudio.com/items?itemName=microsoft-IsvExpTools.PowerPlatform-BuildTools

— Reply to this email directly, view it on GitHub https://github.com/microsoft/powerplatform-build-tools/issues/197#issuecomment-1248576281, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ33J5XOUK5LFLEOH5FACTV6OAVLANCNFSM6AAAAAAQKV7FVE . You are receiving this because you authored the thread.Message ID: @.***>