Replies: 4 comments 8 replies
-
As with many things, the differences come down to the tradeoffs between these different methods. One such tradeoff is in Service Connections: Service ConnectionsADO Service Connections provide a mechanism to share and control access to credentials across multiple pipelines. To take advantage of those, the task in question needs to be built to support them, so they cannot be sent to tasks such as the PowerShell script task. As an alternative to using Service Connections, some auth information such as the username + password flow and the Service Principal via App ID + Tenant ID + Client Secret flow could be fairly easily handled with pipeline variables (or variable groups to share between multiple pipelines). This does however move the responsibility to mark the password or client secret as a secret onto the user, and not doing so could result in the credential leaking in the task logs. Using our Service Connections will always mark those values as secret, and thus ADO will mask those values in the logs without the user needing to do so themselves. The bigger disadvantage to moving to running PAC directly here is in the Workload Identity Federation type. The ADO implementation of WIF sets the federated trust relationship between the Entra ID App and an ADO Service Connection. While there are workarounds to using that WIF Service Connection in that same linked discussion (direct link to the relevant post here), it does take some work to use that federated connection with a direct command line call, and is more of a hybrid approach. |
Beta Was this translation helpful? Give feedback.
-
I initially started using multiple wrappers for pac when ADO tasks did not meet the need, and migrated to using the ADO tasks when the functionality became available. Benefits of the tasks:
The escape hatch of pac pipelines is still very necessary. Perhaps monitor the telemetry of pac from ADO and only create ADO new tasks for the common scenario. |
Beta Was this translation helpful? Give feedback.
-
My deployments tend to be many steps. We're using GitHub actions (while most of the discussion above is about ADO, I would say the same concepts still apply to GitHub actions), and what takes 6 lines in yaml can be 1 in powershell with pac cli. Multiply that by 10 or more steps, and a powershell scripted deployment can fit on one screen vs yaml means lots of scrolling. There's also a lot of redundancy/overhead to just execute what you want to with GitHub Actions (e.g. if I'm importing 2 data files, 3 solutions, and some power pages customizations, its all going into the same environment - which pac assumes - but with build tools, you specify the url, clientid, secret, tenant every time). Additionally, if I always want to perform some additional task as part of one of the build tool actions - say I want to increase my version number when doing a solution export - I have to sequence out 2 steps (the custom script to increase the version number and then the actual export). I find the wrappers to be a nice way of simplifying things when you dont want to write a script, but the verbosity of yaml makes it impractical and error-prone for most of my practical needs. |
Beta Was this translation helpful? Give feedback.
-
Incredible idea! I want to be able to use Two use cases for me:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One of the things we've recently introduced is making it easier to call pac cli directly in script tasks. Here's a trivial example.
For those who may not be aware, the Power Platform Build Tools tasks are almost exclusively convenience wrappers over
pac
, enabling you to executepac
capability using the yaml declarative syntax. We respect that there are strong opinions on the benefits of tasks vs doing the same thing with thepac
directly. Some people prefer doing most of their pipeline work in script tasks and cli's. Some want the convenience of the tasks. One of the reasons we introducedAddToolsToPath
is because there is effort to create each task or enhance tasks as we add capabilities topac
. We can't always get everything inpac
exposed as a task in a given release and sometimes, due to other priorities, many things lag. Furthermore, it's debatable whether everything thatpac
offers should be a task in the first place. The "escape hatch" is "drop to pac in a script task". Personally, I have used this approach myself ever since the tasks were rewritten to bepac
wrappers (and before joining the team). Increasingly, because of my own personal preference of using script tasks, I find myself using the tasks less and less, and calling pac directly in my pipelines more and more.All of this leads to a potentially controversial, thought provoking, and opinionated discussion...
If we continue down this trend to make it "easy button" to use
pac
in script tasks, including making the auth setup more seamless, what's the value of task wrappers overpac
vs callingpac
directly to you?Let the discussion begin...
Beta Was this translation helpful? Give feedback.
All reactions