>> Are you tired of manually exporting and importing solutions?
The Power Platform CLI offers commands for solution exports,
imports back and back,
and a lot more.
David Jenni is here to tell us all about
the solution command group in this episode of Low Code Revolution.
[MUSIC]
>> Hi, everyone, and welcome to the Low Code Revolution.
My name is Daniel Laskewitz and today
we're joined by David Jenni to talk
about the Power Platform CLI and
specifically the solution command group.
Welcome to the show, David.
>> Well, thank you for having me.
Glad to be here. Thank you.
>> Can you introduce yourself to our viewers?
>> I'm David Jenni.
I'm the Engineering Manager in
the Developer and Admin Experiences Team responsible
for all of our ProDev and first part
and code first developer experiences meaning and tooling.
My team is in essence responsible for not only designing but
also fixing and shipping ultimately
the Power Apps or the Platform CLI.
That's been a venture we've been on for a couple years.
I've been around for a while,
I've been at Microsoft for probably 20-plus years now,
so there's a reason I have gray hair, but yeah.
>> You've been there for a very long time then?
Wow, 20 years.
Wow. Power Platform CLI,
we had [inaudible],
your Program Manager counterpart.
We had him last video.
>> Did you realized the similar hairstyles we have?
>> Is that the same reason for it?
Today the subject is
the power platform CLI solution commands group.
I'm really excited to hear about that because
I know the power platform
CLI and I know
the solution command group is one of
the bigger commands groups that are out there.
There are so many commands for it.
What can you tell us about the solution command group?
>> Well, if I just started
with my demo then, that could be a good idea.
My demo of choice here is Visual Studio Code.
One word upfront, you'll realize,
this is actually not a Windows machine,
this is actually my MacBook Pro,
actually the company's MacBook Pro.
A key part of our pac CLI or power platform CLI is we are indeed
cross-platform not only on Windows but also on.NET
Core 6 and 7 for macOS and Linux.
>> How do you get the pac CLI?
>> The easiest way is you go from here,
from the Visual Studio Code.
I'm actually going to make it slightly wider so you see it.
You go actually here to the marketplace and click "Install".
I currently have a preview on,
that's why mine is kind of hidden,
but it's the same experience.
That's the best way to acquire it.
[inaudible] Windows, Mac,
but also for Linux if you're on the Windows.
Azure, or WSL, the Windows Subsystem for Linux.
>> Nice.
>> The key part I state the obvious is
pac and if it gives you pac you get
the help and you will see me using the help quite a bit.
Just because it's an easy way to also
remember what all the different incantations are.
But before we can actually talk about the solution,
we need to talk a little bit about authentication,
because about 50 percent of
the solution verbs in
then that one solution noun are actually connected,
so they require us to know who am I actually
talking and which environment am I actually being connected to.
To do that I would normally check do I
have an already existing connection. I don't.
In this case, what I will need to do is a pac auth
create and if I just use defaults and no nothing,
it will ultimately prompt me in
the macOS and Linux through the system browser.
If I'm actually on a Windows machine,
I would get a dialogue, of course.
I'm just going to go through the authentication flow.
It's going to move me over to the browser,
which is currently not visible.
I just have to confirm my profile and connect it and I'm here.
Since I didn't specify an actual environment,
I'm actually currently connected to
the default environment of the tenant that I'm using.
But that's not really the tenant I would like to use
today or the environment I would like to use,
I would like to use a different environment.
Let's see what environments I have.
But with pac or list I get to see which one I have.
Yes, as a creature comfort item,
I would love to have its own point of star
to actually show which one is my selected one,
which is currently this one.
The one I actually want to use is this one.
I'm going to do a pac org select dash dash environment
and it'll connect me to that one.
I can quickly verify the pac org who,
and it will show me I'm still connected as the same user.
I'm actually connected to the friendly name
of this one or this full URL.
>> You can easily use the name of the URL to connect to that.
You don't have to create a new auth profile?
>> That is a very important part. Thanks for asking.
Yes, I still have only one single entry here.
The original model was a little more complicated where you
actually ended up having to create one for each endpoint,
even though it's the same credentials.
Our best practice, but you can still do the old way,
but our best practice is you create
one auth profile per credential,
per tenant, per username, so to speak,
and then switch back and forth using
pac for select I just used above.
>> I can create multiple auth profiles
where I would have my personal account for instance,
but also by the secret or principal and then
I can switch around between those profiles and also use,
for instance, my personal account
to switch between all the different auths that are there.
>> That is correct. Switching the profile is still the same way.
You just do the pac auth.
Let me get you the command.
We literally go through to select command.
Correct. But only to change the profile as in the credentials,
the authentication credentials, not the environment.
For that, you use pac org select.
>> Yeah. It's really easy.
>> Yeah, that's the idea of it. We did spend
some effort only this year to really make
that token exchange happening behind the scenes that
all of that single sign-on experience actually becomes real.
Now that I actually have connected, I can actually see,
well, let's start with the simplest one.
On my current environment,
that's dj-demo, what solutions do I actually have?
Arc solution list is the answer to that one.
It's going to connect. Since it's a
fairly fresh created one it doesn't have much in it.
That's how we could actually now start doing actual works with
the solution connect to see what
the solution has and so pac solution help.
I've used just the list command to show.
I could also call delete.
Actually, let's not call that one.
But what I could actually do is actually say, well,
I want to have a clone of that solution that is out there,
so pac solution clone,
and the name of my solution was since I'm a lazy typer,
I'm going to copy it.
The output directory, like the hub is my solution.
What it's now doing is actually an export of that solution.
Then it does the unpack. It is
a conceptually a combination of
these commands plus followed by that command.
>> Okay, so it unpacks the zip file as well?
>> It also does exactly.
Let's just look at the program he's typed.
Of course, yes, it wouldn't be
a true demo if it wouldn't have an extra character [inaudible].
It does create the full folder for you.
Since it's an empty one it doesn't have much in it,
but it has the key part is the CDS [inaudible]
that allows me to rebuild it.
An easy way to prove that is even on a Mac I can do that,
of course, since I have.NET installed.
I can do my solution B.
My solution.
This will now rebuild
that solution and which is not that interesting yet.
But the track comment actually follows the git ignore.
That's already laid down,
so that's why you don't see this folder.
Because that folder, actually that's the produce solutions zip.
I can also unpack that again with
pac solution unpack if I wanted not really interesting here.
What is more interesting is actually let me just import it.
>> Let me chip a little quick to help you.
What did I miss?
Again, I can't type. There we go
>> I have said all the time.
>> Exactly. This is a fairly rich set of commands.
The majority of them are special,
and the most obvious one to use is the path,
of course to point that's also the sole required one,
all the other ones unless it's optional.
Let me talk you through a few of them.
This one is actually one to force the override,
I will use that one.
I'm going to skip over some.
I can also say at the same time do not just import,
but also have it published.
I can also do the whole command in asynchronous.
That is probably less
interesting with a small solution like this one,
but it's a large solution,
especially in the CI/CD scenario where a solution can easily
take tens of minutes to import until it's
completed just because of
the sheer size and complexity of the solution.
That's where the async command is important
because without the async flag,
the connection actually gets severed between
the client and the data center after four minutes due
to HTTP clients service iCloud timeouts.
The last one that's interesting and also more special is
the specify deployment settings file and I get
later on on how to create one from scratch
if the solution is using
connection references and environment variables.
>> That's a way to import
the solution with specific connection references in there.
If you have an environment A
and environment B and you have different connections,
you can specify those down.
>> Correct, especially, then that go from
a diff environment to testing versus pod environment,
the intent of course it used to have certain things
parameterized to generally in both variables,
and especially also for connectors and
connection references because they of course
wanted need to be different between development,
test, and prod, correct.
>> Yeah, you don't want to change your source code of course.
>> You don't want to have any solutions
here for just that, exactly.
>> Exactly, yeah.
>> It's added, exactly. Cool. Let me
just end to the input from here.
All I really need is the path,
so that's in this case.
Thanks to Fish Shell, I actually get the benefit
of autocomplete here for the paths.
>> I need to use that as well.
>> Yeah. There we go. On the solution list
will of course, still show it.
I could go up and change it of course.
Let's just do that.
Actually, let me go through the browser,
that's all it is that way.
I'm too lazy and not accurate enough to do that.
What I wanted to change is here the version.
I could change that to 1.4.
I'll clean up my screen again and now I got to just rebuilt,
and now do the input again.
It might actually complain, now,
let's see, and at least it's going to be 1.4.
There's a open way of doing that.
If people want to, there's actually
a packed solution version that also allows for that.
It tries to be actually slightly
clever and has multiple different strategies,
one, for example through git tags,
which actually it's going to set a tag.
All those version commands we
have are actually intended to not change to major,
minor version, which is typically more of
a conscious choice by a human being,
because it's semantic versioning after all,
it's typically intended to just bump the ANY,
if the version has a batch/ build version
at a third or fourth tuple.
That's what that command is being able
to auto increment with certain strategies.
I'm not going to go too deep right now, but yeah.
Now, of course,
another aspect we could do,
which normally I would actually advocate to do
that before I import is actually solution check.
What this one does is actually now
submitting the solution zip to
our solution checker or a power Apps checker endpoint.
It will take the solution zip and it will apply
mostly best-practices rules to tell
me what I should go change
because it's either bad coding practice,
it's either open up performance,
or potentially even security with relevance.
That's what the Solution Checker does,
so in this case,
it's not going to be that long,
and it's probably also not going to find very much issues
because it's practically still an empty solution.
>> Normally you can use this to find errors in formulas,
etc, maybe accessibility errors, that thing?
>> Less accessibility. Think of
it's like Lint or ESLint for variable.
It's along those lines.
It's mostly bad or not
falling best practices or actually using bad practices.
I can actually quickly add to the solution.
I do have a control here.
You see in my solution,
I can do a solution.
What if I were to add my PCF control I already
have checked in here to my solution?
I'm in the wrong folder, I need to go
one deeper. Sorry about that.
Of course. There we go.
If I now rebuild the product,
it will also build my PCF control with it,
add it to the solution.zip,
you'll see it here, the PCF control being built.
It has been added here as a custom control to the solution.zip.
Now, it's a bit that one,
put a solution checker.
We just need to change the path here of course.
It might actually complain about the PCF control, let's see.
It's in essence taking the solution.zip to
that endpoint and zipping it and it's
inspecting certain aspects of it.
There's a similar one already in the maker studio,
the optic checker, it's the same part,
but as I can actually submit it from a solution.zip
I've built here from as a Code First,
or typically more often actually as part of a CI/CD pipeline.
It's still happy, that's good.
I would actually now be ready to import,
of course. That's the maturity.
I'm not sure where we are on time,
but let me actually see all the other commands,
what I want to talk to.
Maybe one I wanted to talk to,
but some of them are obvious like the Publish here,
it has been published,
there's not much to to show here.
Same for the upgrade,
I can actually say stage it and use it up to a full upgrades,
typically when I have more robust or more impactful changes,
that's when people use that.
>> To create settings one,
we talked about little bit?
>> Yeah, that's what we wanted to show through.
That's the one that I just mentioned before.
If I actually ended up having,
I can't see the great help,
so in this case either I already know what a solution is,
I could actually point it to the zip file
I already downloaded or I can also just put it to local folder.
I'll do the folder part here,
so in this case it's literally to
local one because that's where my file is.
What I now I end up having here is a deployment settings file,
which in this case, since it's an empty solution,
it does not have that much interesting,
but it will actually have an array of
environment variables and the array of connection references.
For the actual true clones or
exported solution with either of those,
I will actually end up seeing the entries here,
and then then we can identify them as
the missing information like a connection ID,
etc and then use that for
my future deployments to my test or my product enlightenment.
>> That's really nice because when you add
an environment variable to your solution,
then it will automatically add it here, right?
>> It will actually start to show up here exactly. It's over here.
>> That's really helpful. Yes,
so there's a bunch of really nice commands already in
the solution command group and I think that a lot of people
are really impressed with the world rental of demo she showed,
and yeah, I would love to thank you for this amazing demo.
Yeah, I think that answer our video today.
Thanks a lot for showing all the amazing capabilities here,
and we would love to have you again at another video later on.
To the viewers, please like and subscribe if you like
this video and I hope to see you in the next video. Bye bye.
>> See you.
[MUSIC]