DEV Community

Cover image for Configuring a custom domain for your Azure Static Web App
chsami
chsami

Posted on

Configuring a custom domain for your Azure Static Web App

Configuring a custom domain for your Azure Static Web App is straightforward. Follow these simple steps to get your website running on your own domain.

Step 1: Open the Custom Domains Page

Go to your Azure Static Web App in the Azure Portal. From the left-hand menu, click on Custom domains.

Custom domains page

Step 2: Add a Custom Domain

Click the Add button and choose the option for Custom domain on other DNS.

Add Custom domain

Step 3: Verify Your Domain

To verify your domain, you need to add a TXT record to your DNS provider.

TXT Record

Copy the generated TXT record value and paste it into your DNS provider’s settings. This unique value provides a valid connection between Azure and your DNS provider.

DNS provider TXT Record

For example, if you use Hostinger, it might look like this:

Image description

Step 4: Add a WWW Subdomain

Repeat the process, but this time use www.yourdomain.com instead of yourdomain.com.

Hostinger Example

Step 5: Configure CNAME Records

In the Azure portal, select CNAME and click the Add button at the bottom of the screen.

Add WWW Domain

In your DNS provider’s settings, add or edit the following CNAME records:

  1. For www.yourdomain.com:

CNAME Record for www

  1. For the root domain (yourdomain.com), add an alias (CNAME):

Alias

These configurations make sure your website works with both www and without it.

Done!

That’s it! Your custom domain is now linked to your Azure Static Web App. Enjoy!


Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (0)

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay