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

  1. Create your Function App
  2. Set HTTP Trigger
  3. Add the Custom domain
  4. 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

Configure Custom URL redirection for Windows Virtual Desktop - WVD

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)

Configure Custom URL redirection for Windows Virtual Desktop - WVD

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.

Configure Custom URL redirection for Windows Virtual Desktop - WVD

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.

Configure Custom URL redirection for Windows Virtual Desktop - WVD

Set Function App Trigger

    1. Open
      Function App blade
    2. Click on the created Function App in our case (wvdwebredirection)
    3. Click on the Function tab > Click Add
    4. Click on the HTTP Trigger

Configure Custom URL redirection for Windows Virtual Desktop - WVD

    1. Give the New Trigger Function a Name ( Ex. WVDHttpTrigger )
    2. Select Funcation as Authorization level >
      Create

Configure Custom URL redirection for Windows Virtual Desktop - WVD

      1. Once created open Code + Test Tab, So that we’re going to just delete all the exist code and use Tom’s Code below
      2. Github Link
      3. Only change that you have to do is it change this part (“wvd.3tallah.com“) with yours
      4. Click Save > Click Get function URL > Copy the URL

Configure Custom URL redirection for Windows Virtual Desktop - WVD

  1. Go back the created Function App main blade in our case (wvdwebredirection)
  2. Click on the Proxies tab > Click Add > Give it a Name
  3. Route template just add (/)
  4. Backend URL: paste the Copied function URL > Click Create

Configure Custom URL redirection for Windows Virtual Desktop - WVD

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.

    1. Open
      Function App blade
    2. Click on the created Function App in our case (wvdwebredirection)
    3. Copy Function App URL and Custom Domain Verification ID
    4. Open your DNS Provider to Create new DNS Record.
    5. Create CNAME Record for this Function App URL in DNS provider.
Record typeHostValueComments
CNAMEwvd.azurewebsites.netThe domain mapping itself.
TXTasuid.wvdThe verification ID you got earlierApp Service accesses the asuid. TXT record to verify your ownership of the custom domain.

Configure Custom URL redirection for Windows Virtual Desktop - WVD

    1. Create TXT Record in DNS provider verify your ownership of the custom domain.

Configure Custom URL redirection for Windows Virtual Desktop - WVD

  1. Back to the Function App blade
  2. Click on the Custom domains tab > Click Add custom domain
  3. Enter your corporate URL (Ex. wvd.3tallah.com) > Click Validate

Configure Custom URL redirection for Windows Virtual Desktop - WVD

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

Open http://wvd.3tallah.com

Configure Custom URL redirection for Windows Virtual Desktop - WVD

Resources:

Code that have been used in this demo is being developed by Tom Hickling

Share:

administrator

Microsoft MVP | Speaker | Azure Service Delivery Lead at Bespin Global MEA, helping customers build successful Azure practices. Talks about #AzureCloud and #AI

3 Comments

  • WVD Weekly blog post 30th August – 6th September - WVD Community, September 6, 2020 @ 11:55 am

    […] Mahmoud A. Atallah, has shared a great guide on how to setup and configure URL redirection using Azure functions. This is great for those clients who want their own URL i.e. mydesktops.yourcompanyname.com. You can check out the post here – https://3tallah.com/configure-custom-url-redirection-for-windows-virtual-desktop-wvd/ […]

  • Mark Simonds, September 7, 2020 @ 12:05 pm

    I have followed this guide but when trying to browse wvd.mydomain.com i get the following error

    { “statusCode”: 500, “message”: “Internal server error”, “activityId”: “26c7649c-8dca-4547-afc5-156cf1164b61” }

    • Mahmoud A. ATALLAH, September 7, 2020 @ 1:42 pm

      Apologize, it was my mistake, blog CSS changes any quote format from this ” to this “ thats why you were getting this issue, i have updated the code in the blogpost above, you can give one more try 💪🏻

Comments are closed.