one of the cool things about the cloud and technology in general is that we're
all very connected now and because we are we can actually reach out and help
people across the world even if we don't know them and we never get to meet and
that's what communities like Twitter Linkedin YouTube and the Azure Academy
are all about so you might find something online like a source or a
reference a blog a video and it will help you out to solve a problem or build
a solution and then you can in return give a shout out a comment a like a
thumbs-up to those people and let them know that you appreciate their work and
giving that to the community and I mention this because today's video comes
from a source just like what I've been talking about I've met many customers
who want to set up Windows virtual desktop and one of the questions that I
get asked is can we set up some kind of corporate URLs so when we access Windows
virtual desktop we can do so very cleanly in our environment and up until
now basically I've had to say well there's nothing that we can do from the
Azure side but maybe you could do something creating internal cnames and
and things like that but as of today I don't have to say that anymore because
we've got a solution that'll do this developed by one of the members of the
community out there and we're gonna meet him today as well as talk about
corporate URLs for Windows virtual desktop
I'm Dean Cefola and this is the Azure Academy so our video today comes
courtesy of Tom hickling who is one of our wbb global black belts now I'm sure
you're familiar with the phrase black belt in terms of martial arts it
basically means that they have attained the highest levels of understanding of
that particular discipline and at Microsoft we use that term in that same
manner so a global black belt is someone who's gone through specialized internal
product training usually with the product group themselves and they're
part of the regular ongoing training communications with that team as well as
getting that information out to their customers and the community and in short
basically they know more about the products in the roadmap than just about
anybody else and here's Tom's LinkedIn page you can follow him here as for the
work that he's done for this video as well as other contributions to the
community so let me take you back to where this all started and it's with a
post from Tom that I saw this week so in my Twitter feed this very issue that
I've been talking about setting up a corporate URL Tom had a posting here
about it and we can click here to go check out his blog and I pulled that up
here and basically he's got all the steps well documented to go through and
set up an azure functions app in order to get this done and we're gonna walk
through this process so let's take a look at the specific issue that we're
trying to resolve today so here is my wbd web client and as you can see from
the URL up here this is pointing at our D Web wbd Microsoft com slash web client
slash index dot HTML now there's of course nothing wrong with that URL but
when I give it to people in my corporate environment this is not only a little
bit more difficult to remember but it's also not something that has my corporate
domain here so what I would want instead is something like wvd apps that ms/s
your academy.com that falls in line with what all of my
other internal corporate URLs are I can give it to the helpdesk or very easily
tell somebody within the company go to wvd apps and then you can very easily
get to this site so if we're gonna build this solution on top of a function app
then first we have to understand and what exactly a function app is let's
take a look at the azure Docs so from the main page of the azure Docs we'll go
to products and we'll scroll down here to the table of contents we'll pull up
Internet of Things and right here in the middle we've got functions and this is
just one of the many different resources related to Internet of Things and if
you're interested in jumping down this path give me some comments down below
and we'll see what we can do about that so we pull up functions we've got a
quick link here for what is as your functions and to see where functions fit
into the model of the cloud let's start off with infrastructure now
infrastructure is where we build things like servers virtual machines and those
are made up of processors and memory and storage and you could also throw Network
in there as well and in Azure costs really come from having to run things in
compute or store things so a VM is a large asset that you have to set up to
do something now you can go smaller than that with things like containers and
kubernetes and again if you're interested in learning about kubernetes
then please subscribe because we're starting a series on kubernetes
basically zero to hero and you don't want to miss that
but containers themselves still have to have some amount of compute and storage
associated with them basically as long as they're running now they're smaller
than vm so the cost for running them is potentially less functions are a
different beast altogether they are serverless and that means we don't have
to have compute resources standing by to run this thing it basically runs as just
code segments that are given to Azure directly and they run on the platform of
Azure and the way that it works as you'll see is we're going to just feed
Azure some code and tell a juror to do something with it when it does then
that's going to process and that's going to then take into account the pricing of
how much it takes to run that function app and because this runs in the cloud
you only pay for what you use as with everything in the cloud so if your code
isn't running you're not paying for it so with that let's jump over to the
azure portal and start building so the first thing we need to do is build
ourselves a function app so right at the top here we'll click the plus two
create a new resource and we're going to search for functions and we'll click on
our function app and hit create I like building all other resources we need to
put this into a resource group and I've already got one here for wvd management
so I'll use that and we'll give our function app a name then you can choose
to run this as code which would be that serverless option or run it in a
container and we're gonna choose the server list option here so for our
runtime stack we're gonna set up dotnet core and then we're gonna provision this
in whichever region you like I'll choose east us and we'll click Next for our
hosting options and even though dotnet core works on Linux and Windows will be
choosing Windows for this and then for our plan here this has to do with the
pricing will be choosing consumption although back in the docs you can read
about the premium and apps service based approaches as well and so we'll hit next
now in this case I'm going to turn off application insights because basically
we're only doing one thing here but you could leave this on if you want to have
this monitored in case somebody goes and changes your DNS entry for example but
I'll just leave this off and we'll hit next and we'll add some appropriate tags
I'll add one here from my cost Center as well as my application and environment
and I'll even throw in a support contact and we'll hit next and we'll click
create
function app is done and that gives us a app service here that's the function app
itself an app service flan which is the compute that it's connected to when it
runs and there's also a storage account here in case we need to store any data
let's open our function app and just to give you the quick tour of course we
have our banner across the top here because we chose not to turn on
application insights because that is recommended then we have here an
overview and a platform features section and in the overview this is where we can
start and stop the function app or restart it we can get our published
profile if reset your profile download your content or delete it and then we've
got our URL that we entered when we created it which app service plan it's
tied to and what the pricing tier is these stuff here on the left we'll get
into more in a moment and then here at the bottom we need to set up a new
function so we'll click this button and that's opened a new tab for us here at
the top and because we've set this up as dotnet core these are the options that
were presented with and we actually want this bottom one here to do this in the
portal and then we'll hit the continue button at the bottom and in this section
we're going to select more templates and then hit finish and view our new
templates and the one that we want because we're dealing with a URL would
be an HTTP trigger so we'll click on that we need to give our trigger a name
then we have to give our trigger a certain authorization level and our
choices here are making it a full admin anonymous and then function and that'll
give the function app itself permissions to do what it needs to do and that's
what we're gonna choose and hit create and this is the code that's going to
execute inside our function app so that we're going to just delete it all and
for the code itself we can get that right off of Tom's blog so let's go back
there about halfway down the page we'll find all the code that we need to run
this and we'll just copy that and go back to Azure and here in our function
app we'll just paste all that code now the one change that we do have to make
to the code to make it work for each one of our individual environments is line
32 here and that's the URL that we're going to do a redirect on so if you were
to set this you would go to my apps contoso comm when you did it would be
redirected to the Ardi webclient so we need to change this
to whatever vanity URL you are using in your environment and I'll set mine as I
said earlier to wbd apps MSS your academy.com and then we'll hit the Save
button at the top once that's complete then click this get function URL and
we'll hit the copy button to copy that because we're going to need that for the
next step and then we can close this box now over here on the left side we can
see the name of our function and then inside there the individual processes so
we've set up a wvd trigger now we need to set up a proxy so for the proxy here
we'll click the plus and then our proxy needs a name I'll just call it redirect
proxy the route template here will just be a forward slash and our methods will
be all methods and then we just paste in our URL from our function trigger and
then we click create then you can see on the left now we've got our redirect
proxy so going back to the main part of the function app we need to now set a
custom DNS that's going to match our vanity URL so that's a platform a
feature so click that and then click on custom domains and in our custom domains
here we'll click the Add button in the center for adding a custom domain and
then you can add that right up here on the top and then you can click validate
now whenever you set up some kind of redirect to a vanity URL and that means
you're creating a cname record you'll have DNS somewhere in the world that's
configured to handle this so our URL that we have to target is MSAA - Corp -
URL dot as your website's dotnet but I'm putting in front of that the C name of
wvd apps that I massage or academy.com you have to own that domain and wherever
it is that you manage that domains DNS entries is where you would set up this
cname record now you may be wondering if we're creating a cname record already
why do we need the function app in the first place well the reason for this is
cname records only map from a domain name to another domain name for example
wvd apps a massager academy.com will map to our D web dot WV d microsoft
com now you cannot to a specific site within that domain
name in our case getting to the html5 client is in the site of web client and
then there's the index.html page and in order to get to there we need to be able
to map that directly so that our wvd apps can go right in and we don't have
to put in any other slashes or index pages or anything like that I do this
with my as your public dns account and let me show you what that looks like and
this is my public DNS zone for MSS your academy.com
and if you missed our previous video on as your DNS you can go here in the
pop-out on the top right that's the YouTube card and you can go check out
that video first thing that you need to do is click to add a record set then you
would add your front end of the URL here in this case wbd apps and then that has
the rest of your domain name already here the record type you would add would
be a cname and then you can also add your time to live and then put in your
alias that would be the MSAA - Corp - URL dot as your website's dotnet and as
I said I've already completed this step it's all cancel out of that and you can
see I've already got that record present once you do have that and you click
validate it'll show that you do own your domain and the host name is available
and then you can click the add custom domain button and then added for HTTP
but not for an SSL state so if you want you can add a SSL certificate and do a
binding here or that you can make this secure I'm gonna skip this step because
this is just my lab now we should be able to test this so let me pull up a
private page and we'll go to wvd apps that MSI's your academy.com and when we
do it redirects us to the proper login and I'll enter my credentials sign in
and it successfully redirected us to our proper URL and now we can log in and use
wbd as normal did not work great but let's take this a step further remember
in our original example I showed you that this was the problem that we were
trying to solve what about the wvd management console the URL for that is
rather long as well wouldn't it be easier to
just go to wvd management a massager academy.com
well we can repeat the same process so in the search bar at the top of the
azure portal we'll just type function and we'll click on our function app and
you can see the one that we have been working with and there is the one I've
set up for wvd management and I've done the same process that we already looked
at so we've set up a trigger here and that triggers using the exact same code
from Tom's blog and we've updated line 32 we're using WB d mg TM s as your
academy.com and this time we have also changed line 35 and that is our new URL
for my wvd management portal and just so you can see them both together here is
our original that we were working on for WD apps line 32 and 35 or responding to
the html5 client and our new one for wvd management with my wvd web management
portal and then we've set up our proxy here as well just like we did earlier
copying in our back-end URL and in the main part of the function under the
platform features we set ourselves a custom domain or WB dmg T and then we
also added the public as ur DNS record and opening a new private browsing page
let's go to that URL WV dmg T dot MSS your academy.com
and there we go are redirected to our wvd management portal works and now we
can get into here and manage our tenant all from our corporate URL I hope that
you've enjoyed this quick look at as your functions and how we could use them
for a variety of purposes in today's video of course making a corporate URL
for our Windows virtual desktop sites to make it easier for everybody to get to
our wvd resources and be able to manage them and if you thought that this video
was good please do give us a thumbs up and click on the subscribe button and
join us here at the Azure Academy and become part of a community of people
trying to learn all they can about a sure contribute to the community by
giving us some calm down below or asking questions about
this video or any other topics you're wondering about and if you'd like to get
an email when our videos come out which is roughly once a week you can click on
that email notification bell thanks very much for joining us today and make sure
that you thank Tom for his contributions as well happy learning