Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Kindly try the below sample commands to update your domain in azure front door:
# Set variables (Replace with your actual values)
$resourceGroupName = "YourResourceGroupName" # Replace with your resource group name
$frontDoorName = "axv3"
$routeName = "route1"
$newDomain = "test2.axv3-dns.com"
# You can get the existing Front Door route by using below command:
$route = Get-AzFrontDoorRoute -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name $routeName
# You can get the existing domains by using below command:
$existingDomains = $route.Domain
# You can add the new domain to the list by using below command:
$newDomains = $existingDomains + $newDomain
# You can update the route with the new domain list by using below command:
Update-AzFrontDoorRoute -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name $routeName -Domain $newDomains
# Also, you can verify the update by using below command:
$updatedRoute = Get-AzFrontDoorRoute -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name $routeName Write-Host "Updated Domains:" $updatedRoute.Domain
- Before you can use test2.axv3-dns.com with Front Door, you'll need to validate it. This usually involves creating specific DNS records (like TXT or CNAME records) as instructed by Azure Front Door during the validation process.
- You can add a new domain using the New-AzFrontDoorCustomDomain cmdlet and validate it with Update-AzFrontDoorCustomDomainValidationToken.
- If you want traffic to test2.axv3-dns.com to follow the same routing rules as test.axv3-dns.com, you might not need to change the "Patterns to match" field.
- However, if you want different behavior for each domain, you'll need to adjust the path patterns accordingly.
Kindly let us know if the above helps or you need further assistance on this issue.
If it was helpful, please click "Upvote and Accept Answer" on this post to let us know.
We're here to help, so if you have any further questions, don't hesitate to ask.
Thanks,
Sai.