Power Pages custom domain not working: incorrect URL mapping and SSL
Custom domain won't connect? Check the site is in production, the CNAME is public and propagated, the TXT record is current and the certificate is one it accepts.
Power PagesFix a problem9 min read
You try to connect a domain such as www.example.com to your site in the Power Platform admin center, and it stops. The host name step says there's an incorrect URL mapping error. Or domain validation never lets you go on, or the certificate option you expected isn't there. Or the domain connects, and your sign-in providers still point at the old address. Microsoft documents a requirement for each step of the setup, so the fix is to check them in order.
- You can't add a domain: the site is still a trial, or it already has a custom domain.
- Entering the host name gives an incorrect URL mapping error.
- On Validate the domain, selecting Refresh never activates Next.
- The Microsoft managed certificate option is missing, or you're not sure your own .pfx meets the rules.
- The domain works, but your identity providers still use the old reply URL.
How the setup works
Per Microsoft's documentation, you connect a domain from the site's page in the Power Platform admin center: under Resources, open Power Pages sites, select your site, select Manage, then select Connect Custom Domain in Site Details. A side panel walks you through these steps, in this order:
- Choose an SSL certificate.
- Enter the host name.
- For a site with a content delivery network (CDN) or Web Application Firewall (WAF), validate the domain with a TXT record.
- Review the host name and certificate, and create the SSL binding.
Your DNS provider needs a CNAME record before step 2, and your identity providers need the new address after step 4.
- Microsoft Power PagesA production site with no other custom domain
- Step 2A public CNAME on www.example.com, not the root domain
- Step 3A Microsoft managed certificate, or a .pfx that meets the rules
- Step 4The host name, once DNS has propagated, or an incorrect URL mapping error
- Step 5With CDN or WAF, the current TXT record
- Step 6The SSL binding
- Step 7Identity providers updated to the new reply URL
Check the site first
Two rules come before any DNS work:
- The site must be in production. Microsoft says you can add a custom domain only when the website is in production state. Every site starts as a trial. An admin converts it to production from the admin center, which needs a production or sandbox environment and the right licences. A developer site can't be converted. Our Power Pages licensing guide covers the licences.
- One custom domain per site. To swap the domain, select the pencil icon beside the custom URL in Site Details, delete the current SSL binding, then the certificate, then the host name, and run the setup again with the new domain.
Fix the CNAME record
At your DNS provider, create a CNAME record that points your host name to your site's Power Pages URL, such as contoso.powerappsportals.com. Microsoft lists three ways this goes wrong:
| Problem | What happens | Fix |
|---|---|---|
| The CNAME hasn't propagated yet | The host name step shows an incorrect URL mapping error | Wait and retry later; new records take time to reach every DNS server |
The host name is the root domain, such as example.com | A CNAME can't be mapped to a root domain | Use a subdomain, such as www.example.com |
| The record exists only in a private or internal DNS zone | Power Pages can't validate it, and setup fails | Create it in public DNS |
Before you enter the host name, check that the record resolves publicly. On Windows:
nslookup -type=CNAME www.example.com
On macOS or Linux:
dig CNAME www.example.com
If the record doesn't resolve publicly yet, Power Pages can't validate it. Wait, then check again before you go back to the panel.
CDN or WAF: add the TXT record
If your site has a content delivery network or Web Application Firewall turned on, the setup adds a Validate the domain step. Both features run on Azure Front Door, and this step proves you own the domain before Power Pages routes traffic through it.
- In the panel, copy the Record type (TXT), Record name and Record value. Microsoft's example name is
_dnsauth.www. - Create a TXT record with those values at your DNS provider.
- Check it's public, with the command below.
- Back in the panel, select Refresh. When the record is validated, Next becomes active.
nslookup -type=TXT _dnsauth.www.example.com
If Next doesn't become active, check these:
- The value expired. The record value in the panel has an expiry. If you didn't create the record in time, Power Pages generates a new token, and the old one never validates. Copy the value shown now and update your record.
- An old
asuidrecord is in the way. There must be no TXT record namedasuid.<your domain>, such asasuid.www.example.com. Delete it and try the binding again. - DNS is still catching up. Microsoft says WAF domain validation typically completes within minutes to 48 hours.
Turning on CDN or WAF later, on a site that already has a custom domain, can also trigger this validation: Microsoft says enabling either feature for the first time triggers domain validation for custom domains.
Choose a certificate it accepts
The panel offers three options:
| Option | What it means |
|---|---|
| Add Microsoft Managed certificate | Microsoft provisions, configures and renews the certificate for you. It can take a few minutes to configure. |
| Upload a new certificate | You upload a .pfx file and enter its password. |
| Use an existing certificate | You pick a certificate you uploaded before. |
The managed option is missing? It isn't shown when CDN or WAF is turned on. Upload your own certificate instead. Azure Front Door also creates its own certificates for those sites, separate from the one you upload, and you stay responsible for renewing yours.
Using your own .pfx? Microsoft lists what it must have:
- It's signed by a trusted certificate authority.
- It's exported as a password-protected .pfx file, encrypted with TripleDES. AES-256 encryption isn't supported.
- Its private key is at least 2,048 bits long.
- It includes every intermediate certificate in the chain.
- It's SHA2 enabled.
- It has the Extended Key Usage for server authentication (OID 1.3.6.1.5.5.7.3.1).
Microsoft notes that the export steps vary by certificate provider, so follow your provider's instructions and check the encryption before you upload.
When the certificate expires or won't update
Per Microsoft's renewal steps, uploading the renewed certificate is only half the job: you also replace the binding that uses the old one.
- Get the renewed certificate as a password-protected .pfx, encrypted with TripleDES.
- In Site Details, select the pencil icon beside your custom domain.
- In the Edit Custom Domain pane, choose New and upload the renewed .pfx.
- Delete the existing binding that uses the old certificate.
- Create a new binding with your host name and the new certificate.
To move between your own certificate and a Microsoft managed one, delete the SSL binding and the certificate, then run the setup again.
Update sign-in reply URLs after the domain connects
Each identity provider sends visitors back to your site at a reply URL. Microsoft says that if you use or add a custom domain name, you must set up your identity provider to use the correct reply URL.
- In Power Pages design studio, open the site and select Security > Identity providers.
- Next to each provider you use, select More Commands (…) > Edit configuration. Where its settings have a redirect URL, enter the custom URL. The Local sign in and Microsoft Entra providers can't be changed here; Microsoft says to use site settings for those.
- In the provider's own app registration, such as one in Microsoft Entra ID, set the redirect URI to the same custom URL. Microsoft asks for the two values to match exactly.
- Changes can take a few minutes to show. To see them at once, restart the site from the admin center.
Once sign-in works on the new address, our guide to web roles and table permissions covers what they can reach.
Using your own Azure Front Door
If you put your own Azure Front Door in front of the site, rather than the built-in CDN or WAF, Microsoft's order matters. Browsers reject the site's cookies when the Front Door address differs from the site's address, so:
- Connect the custom domain to the Power Pages site first, with its CNAME pointing at the site.
- Then change only the CNAME at your DNS provider to point at the Front Door endpoint, and add the same domain to Front Door.
- Check with
nslookupthat the CNAME now returns the Front Door endpoint, and that browsing to the domain shows your site.
Do
- Create the CNAME first, and check it publicly before you start.
- Use a subdomain such as
www.example.com. - Copy the TXT value from the panel at the moment you create the record.
- Export your .pfx with TripleDES.
- Update every identity provider's reply URL after the domain connects.
Don't
- Don't try to connect the root domain.
- Don't rely on a record that exists only in a private DNS zone.
- Don't leave an old
asuidTXT record in place. - Don't upload a renewed certificate without creating a new binding.
Sources
- Add a custom domain name — Microsoft Learn
- Power Pages lifecycle — Microsoft Learn
- Use the admin center: Site Details — Microsoft Learn
- Content Delivery Network — Microsoft Learn
- Web Application Firewall (WAF) for Power Pages — Microsoft Learn
- Set up site authentication — Microsoft Learn
- Set up an OpenID Connect provider with Microsoft Entra ID — Microsoft Learn
- Set up the Microsoft provider — Microsoft Learn
- Set up Azure Front Door with Power Pages sites — Microsoft Learn
Add LowCodeStacks as a preferred source on Google
Did this fix it?
Comments
No comments yet. Share what worked for you.
Sign in to comment. Comments show under a display name you choose, never your email.