Home > Software engineering >  Jenkins - Automate Azure PowerPlatform - PAC CLI
Jenkins - Automate Azure PowerPlatform - PAC CLI

Time:01-24

I'm trying to find a way to automate pipeline in Jenkins using the PAC CLI (enter image description here

This is the batch file content:

@ECHO OFF
start cmd.exe /c "PAC > out.txt"

I'm suppose to see the PAC output (like you run in CMD) printed in the txt:

Microsoft PowerPlatform CLI
Versione: 1.10.4 gf23be2f

Utilizzo: pac [admin] [auth] [canvas] [help] [org] [package] [paportal] [pcf] [plugin] [solution] [telemetry]

  admin                       Utilizza il tuo account amministratore di PowerPlatform
  auth                        Gestisci la modalità di autenticazione per vari servizi
  canvas                      Utilizzo dei file .msapp Power Apps in corso
  help                        Mostra la Guida di Microsoft PowerPlatform CLI
  org                         Collabora con l'organizzazione Dataverse
  package                     Comandi per l'utilizzo con progetti del pacchetto Dataverse
  paportal                    Comandi per l'utilizzo con il sito Web del portale PowerApps
  pcf                         Comandi per l'utilizzo con progetti PowerApps component framework
  plugin                      Comandi per l'utilizzo con la libreria di classi plug-in Dataverse
  solution                    Comandi per l'utilizzo con progetti di soluzioni Dataverse
  telemetry                   Gestisci impostazioni di telemetria

Launcher usage: pac [install] [use]

  install <version# | latest> Install 'latest' or a specified version of the Microsoft PowerApps CLI
  use <version# | latest>     Use 'latest' or a specified version of the Microsoft PowerApps CLI

actually is totally empty, and if I run the "AZ" with this command:

@ECHO OFF
start cmd.exe /c "AZ > out.txt"

it works. Is there any better way to make it work? thx

CodePudding user response:

For some reason the PAC cli path is not recognized from Jenkins. Solution is to locate the PAC using "where" CMD command and include the full path into Jenkins

C:\Users\jenkins>where pac
C:\Users\jenkins\AppData\Local\Microsoft\PowerAppsCLI\pac.cmd

Then into jenkins:

C:\Users\jenkins\AppData\Local\Microsoft\PowerAppsCLI\pac.cmd > out.txt (or any command)
  •  Tags:  
  • Related