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

Installing build tool Windows #234

Closed aaden001 closed 2 years ago

aaden001 commented 2 years ago

I have been checking around and only came across installing the build tools on Azure Devops. What if my dev environment is not azure devops ? Is there a way to install build tools on local windows machine with a PowerShell script for use?

devkeydet commented 2 years ago

The Power Platform Build Tools are (by definition) for Azure DevOps: https://learn.microsoft.com/en-us/power-platform/alm/devops-build-tools image

It is a package of Azure DevOps tasks, so they require Azure DevOps. If you are using the onprem Azure DevOps server, you can install them manually by using the option to download the vsix from the marketplace.

https://marketplace.visualstudio.com/acquisition?itemName=microsoft-IsvExpTools.PowerPlatform-BuildTools image

The Azure DevOps tasks inside the Power Platform Build Tools vsix are a wrapper around the Power Platform CLI: https://learn.microsoft.com/en-us/power-platform/developer/cli/introduction

The Power Platform CLI is a cross platform CLI that can be used from any automation technology that can acquire and run a CLI. It's available on nuget.org: https://www.nuget.org/packages/Microsoft.PowerApps.CLI

Here is an example of acquiring and using it directly without installing the Power Platform Build Tools or GitHub Actions for Power Platform.
https://github.com/devkeydet/install-use-pac-nuget/blob/main/.github/workflows/acquire-run-pac.yml

The example above is a bit contrived because it is running in a GitHub Workflow and there is already GitHub Actions for Power Platform, which is what most customers would want to use if using GitHub: https://learn.microsoft.com/en-us/power-platform/alm/devops-github-actions

But the example is intended to show people that if you are using any CI/CD technology that allows you to run a CLI (which I believe is all of them), then you can accomplish the same things that Power Platform Build Tools accomplishes with extra convenience for Azure DevOps, but on any CI/CD platform.

devkeydet commented 2 years ago

If you just want to install the Power Platform CLI on your PC, then the learn link above provides you instructions on how. If you use winget, you can also run:

winget install Microsoft.PowerAppsCLI

aaden001 commented 2 years ago

Thank you, that was very helpful. I have one more question regarding import(from power platform to local machine) an existing canvas app through the power platform cli after connecting to the environment.