Table of Contents
By default, all users are accessing their browser-based virtual desktops is via the same link using a Microsoft URL which is same for all customer (https://rdweb.wvd.microsoft.com/webclient/index.html)
As this URL is a bit long as well as not that easy to memorize, most of entities will be looking for setting their own Custom URL using the corporate domain name. same idea as myapps.3tallah.com or mail. 3tallah.com, for sure it would be up to you to set your preferred subdomain name.
In this blogpost we are going to use Azure Functions, which allows you to execute your code in a serverless compute platform, and the consumption plan pricing includes a monthly free grant of 1 million requests, this would be saving you from the hassle of creating, configuring and securing an IIS virtual machine and will as the cost of compute.
So with that here’s what I’m going to cover in this demo
- Create your Function App
- Set HTTP Trigger
- Add the Custom domain
- Test and validate
Create your Function App
Open Create a Function App blade
- Subscription: Select the subscription where the new Function App will be created.
- Resource group: Create a new resource group or use an existing one.
- Function App name: Enter globally unique name for the Function App (Ex.
wvdwebredirect01) - Publish: Select (Code)
- Runtime stack: .NET Core
- Version: 3.1
- Region: Select the (Region) where you want to create the Function App
When creating a function app, you must create or link to a general-purpose Azure Storage account that supports Blobs, Queue, and Table storage. Select The Operating System that’s recommended for you based on your selection of runtime stack, And The plan that dictates how your app scales, what features are enabled, and how it is priced.
- Storage: Create a new Storage
Account or use an existing one. - Operating system: Select (Windows),
- Plan: Select (Consumption Servless)
Application Insights is a code-less attach to provide detailed observability into your application.
Don’t enable Application Insights as its not really required for this scenario.
Function app creation is completed and that gives us an app service that’s the function app itself, an app service plan 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.
Set Function App Trigger
-
- Open
Function App blade - Click on the created Function App in our case (wvdwebredirection)
- Click on the Function tab > Click Add
- Click on the HTTP Trigger
- Open
-
- Give the New Trigger Function a Name ( Ex. WVDHttpTrigger )
- Select Funcation as Authorization level >
Create
- Give the New Trigger Function a Name ( Ex. WVDHttpTrigger )
-
-
- Once created open Code + Test Tab, So that we’re going to just delete all the exist code and use Tom’s Code below
- Github Link
- Only change that you have to do is it change this part (“wvd.3tallah.com“) with yours
- Click Save > Click Get function URL > Copy the URL
-
- Go back the created Function App main blade in our case (wvdwebredirection)
- Click on the Proxies tab > Click Add > Give it a Name
- Route template just add (/)
- Backend URL: paste the Copied function URL > Click Create
Add the Custom domain
Last step is to add your corporate domain as a custom domain lets hit to Custom domains tab so we can configure and manage custom domains assigned to your app.
-
- Open
Function App blade - Click on the created Function App in our case (wvdwebredirection)
- Copy Function App URL and Custom Domain Verification ID
- Open your DNS Provider to Create new DNS Record.
- Create CNAME Record for this Function App URL in DNS provider.
- Open
Record type | Host | Value | Comments |
CNAME | wvd | .azurewebsites.net | The domain mapping itself. |
TXT | asuid.wvd | The verification ID you got earlier | App Service accesses the asuid. TXT record to verify your ownership of the custom domain. |
-
- Create TXT Record in DNS provider verify your ownership of the custom domain.
- Create TXT Record in DNS provider verify your ownership of the custom domain.
- Back to the Function App blade
- Click on the Custom domains tab > Click Add custom domain
- Enter your corporate URL (Ex. wvd.3tallah.com) > Click Validate
It’ll show that you do own your domain and the hostname 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.
Test and validate
Resources:
Code that have been used in this demo is being developed by Tom Hickling
Check out my Udemy course for AZ-140 Azure Virtual Desktop
Use This link for 80% OFF