United States | Azure Functions – URL Redirects Made Easy

Shane Fisher - 18.08.202020200818

Azure Functions – URL Redirects Made Easy

United States | Azure Functions – URL Redirects Made Easy

Whilst working across engagements helping customers to migrate their existing Active Directory Federation Services (ADFS) Relying Party Trusts to Azure Active Directory (AAD), a requirement came up which needed a URL redirect to a particular “My Apps” URL to maintain the original application URL while improving the user logon experience and security posture.

After the initial implementation of IIS to handle the requirement and perform this task, I got to thinking that there must be a better way to achieve the required outcome using cloud services.

Enter Azure Functions. Azure Functions are defined by Microsoft as follows:

“Azure Functions is a serverless compute option. It uses an event-driven model, where a piece of code (a “function”) is invoked by a trigger. In this architecture, the function is invoked when a client makes an HTTP request.”

This is the perfect use case for an Azure Function. Below is the process we used to meet a simple URL redirect requirement:

1. Create a simple Azure Function from the Azure Portal based on .NET core

2. Create a new proxy within the Azure Function previously created

United States | Azure Functions – URL Redirects Made Easy

3. Add a “/” under “Route template” and leave the backend URL blank. The backend URL would normally be the target URL when not using an override response. Configure the “Response Override” section per the below image. The Response Override section defines changes which are made to the response passed back to the client

 

United States | Azure Functions – URL Redirects Made EasyUnited States | Azure Functions – URL Redirects Made Easy

4. Add a new custom domain to the Azure Function to prevent certificate errors when using the application.domain.com URL

United States | Azure Functions – URL Redirects Made Easy

a. Enter the custom domain i.e. application.domain.com. If utilising a wildcard certificate, the custom domain is defined as *.domain.com

United States | Azure Functions – URL Redirects Made Easy

b. Create the required public DNS records to provide proof of ownership for the domain

i. Use the format asuid.application.domain.com for TXT record if not using a wildcard certificate

ii. Use the format asuid.domain.com for the TXT record if using a wildcard certificate

 

United States | Azure Functions – URL Redirects Made Easy

iii. Create the CNAME record in the format application.domain.com i.e. example.contoso.com

iv. Once the validation check returns all green, click “Add custom domain”

United States | Azure Functions – URL Redirects Made Easy

v. Click “Add binding”

vi. Upload the SSL certificate used to secure the application.domain.com URL in PFX format

1. Select the custom domain to be used

2. Select the certificate thumbprint

3. Select SNI SSL as the TLS/SSL type

vii. We have now successfully added a custom domain

United States | Azure Functions – URL Redirects Made Easy

The above walkthrough shows how easy it is to create a simple URL redirect using Azure Functions. Obviously, there are much more advanced configurations which can be applied using Azure Functions, however, the purpose of this blog was to demonstrate the simplicity of a basic implementation to achieve a specific outcome.

Azure Functions are a cool cloud-native, scalable, low-code, or no-code solution which can be enabled quickly and easily to meet many different requirements. Azure functions are particularly cost-effective when considering what the free pricing inclusions are:

“The first 400,000 GB/s of execution and 1,000,000 executions are free.”

I hope this post has provided you with some new insight into the user of Azure Functions.

THANK YOU FOR YOUR SUBMISSION!

United States | Azure Functions – URL Redirects Made Easy

The form was submitted successfully.

Join the Insentra Community with the Insentragram Newsletter

Hungry for more?

If you’re waiting for a sign, this is it.

We’re a certified amazing place to work, with an incredible team and fascinating projects – and we’re ready for you to join us! Go through our simple application process. Once you’re done, we will be in touch shortly!

Who is Insentra?

Imagine a business which exists to help IT Partners & Vendors grow and thrive.

Insentra is a 100% channel business. This means we provide a range of Advisory, Professional and Managed IT services exclusively for and through our Partners.

Our #PartnerObsessed business model achieves powerful results for our Partners and their Clients with our crew’s deep expertise and specialised knowledge.

We love what we do and are driven by a relentless determination to deliver exceptional service excellence.

United States | Azure Functions – URL Redirects Made Easy

Insentra ISO 27001:2013 Certification

SYDNEY, WEDNESDAY 20TH APRIL 2022 – We are proud to announce that Insentra has achieved the  ISO 27001 Certification.