Bonjour, hi welcome in another video of cloud and five minute let me introduce
myself I'm Frank Boucher Microsoft Azure MVP based in Montreal in Canada today we
continue to talk about the Azure DevTest lab and I will show you how to create
custom artifact you'll see it's not that complicated this is the third video
about deafness lab to see the previous one I will put the link in the
description a lot of time when we use the dev test lab it's to test our own
private code that we are working on so we don't want that sitting on github
it's probably in VST s or in a private repository so that's why today I want to
create a custom artifact that question came from Damien so thanks Damien for
your questions you want to know how to create a custom artifact that will fart
in this case change the timezone so that's exactly what we will do one of
the frequent questions I have is how do you know all those template and how can
I know them well to get started it's easy with Azure it's right in the portal
so if you go into portal this is my dev test lab the second one in the options
is getting started if you click on that you will have a lot of URL very useful
and if you look down there here I see simple artifacts and script you click on
that it will open the github repository where all example are displayed and if I
scroll I could see that I have a folder named artifacts I will click on it and
that's all the artifacts they are all listed there so because I want to
execute a PowerShell command I will have a look to something PowerShell related
so if I look I have here Windows run PowerShell let's look pretty close to
what I want to do in that specific folder you will always
find a file name artifact file Jason this is really important and you cannot
change that name so let's have a look to this file so it looks like a simple JSON
file with a title a description publisher some tags very useful then do
you the hike on URL you will see parameters I will show you later where
parameters showed and then you got your execution ok so I think we know enough
to create our own so first we need a private repository you could use any
kind of git repository I will use one in VST s so I'm in VSDs and we'll create a
new project I will call it cloud five minutes
artifacts and like you could see here it's private ok the project is created
now I just want usually you will have cloned the environment on your machine
build your code from there pushed any more work because it's a demo I will
work directly in VST s since they include a code editor so I will need to
initialize my repository so now I need a main folder I will name the artifacts
and because in get a folder cannot be empty I need to create a file so we'll
just put a readme file for now the readme file will be empty and I am
committing perfect so now I have my root and I don't know how to spell readme
apparently so I need to create another folder because every artifact need to be
enclosed in his own specific folder so I need to create a new one so another
folder my artifact is only windows-based so it's the best practices if your
artifact is only working on a specific platform
to name it with it so window set time zone will be the name of my folder for
my artifact so like we saw an artifact is always declared inside the artifact
file that Jason so we'll create that so I took the liberty here to take the json
file that we saw previously and just clean it so here we see that i have a
title i'm using i'm just putting a description that makes sense
publisher is my name you could put the company name or whatever you want and
then the icon URL it will be interesting in the list to put something personal
this icon need to be sitting in a public zone so i could be on github it could be
a blob storage it could be a website here i just choose an existing one in
the git repository and then I have my command so for my specific case I will
be using the I will be executing the command TZ util to set the timezone and
because I'm Eastern Standard Time I will just set it to that I could have pass a
parameter and then set the parameter here but I want to keep it as simple as
possible if you set a parameter I will show you later where that parameter will
appear perfect so now let's commit great so now we are on the master branch the
root folder is named artifacts and we have one artifact called windows set
time zone great so now we need to use that repository inside or deafness lab
we need to make the connection so to do that we'll go in the azure portal so go
back in our azure portal and we'll go in configuration and policies so here in
the left panel you will see a repository so click on that and here we have the
one right now is the public one so will had a new one so now we need to give it
a name so let's call it Frank rifle people sorry Frank cripple so now we
need the URL of our get triple envious I will show you envy STS but of course it
may differ if you were using something else but most of the time you will see a
clone button in your repository so you click on that and that will give you
your URL so you will use this remember I was in the master branch of course if
you're using another branch that is queue way or dev you will use that name
here to access the repository since it's
private you will need to use a personal access token to get this token in VSDs
you will need to go in your profile security and generate access token then
we need to specify the root of our artifact so in our case it was artifacts
so what so we're good to go safe excellent so now we have our
repository that is accessible from our dev test lab let's create formula that
use this repository of course we could create a VM directly but since I show in
the previous video how useful word from the formula I will continue with those
so let's go back at the lab level and I will list the formulas so we'll create a
new formula and I will create a visual studio machine so let's see yeah that
one we'll name it dev box use your name Frank SSD will
give more CPU so it's faster
and the moment of truth the artifact quest so here we have artifact set time
zone execute the TZ u TL command publisher Frank Cuccia so exactly what
was specify in the decent file if I add parameters they will be listed here so
perfect so click on add and that's it for now we'll just put that since it's
the only thing I want to use great so now we have a formula okay so let's
recap we have our repository of artifacts inside we declare a one
artifact we connected that artifact list to our dev test lab created one formula
using that artifact and of course the only thing left now is just create a VM
using that formula so to do this we'll go in all virtual machine or create add
so I will use my formula so should be all populated excellent and I just need
to create it what I will cut it there and I will see you when the VM is
created so the VM is now created so let's have a look inside and see if our
artifact ports yes so many pop-ups so the time for Easter time is 822 so if I
check in vain it's 822 it works that's great now you know how to do it
in the portal in the previous episode I showed you how to create using the arm
template so how could you do that to know what kind of resources repository
is we need to go in the resource Explorer and then you all from the
resource Explorer found again your resource group and then your lab and
then you will find artifacts sources and here it is
our cloud 5-minutes repository we created so the type is artifact sources
we can even go on the Microsoft documentation and we'll see here the
documentation so this artifact sources you will need to inject it in your arm
template at the second resource list so if you remember an arm template is a big
JSON file and you will have a first node called resource inside that one you will
have one that is a dev test lab and inside that dev test lab you will have a
second node named resources it's in that node that you will add your artifact
sources at the same level where the network virtual network was and of
course to use our artifact in your formula you just need to refer as it was
done previously with the public one but this time you will refer the private one
voila it was that easy to create a custom artifact in a dev test lab I hope
you liked this video and I hope it was useful don't this date to share and give
me a thumbs up if you liked it and of course reach out and ask questions I'm
always happy to help you guys to see all the videos about deafness lab have a
look to us here or if you want to see another video of Club in five minutes
click here thank you for watching