Forum Discussion
Frontdoor Custom Domain in Bulk
Hi Everyone.
We are on the brink of migrating our onprem workload to Azure AKS.
We have hundreds of clients and every client has its own subdomain p.e client1.contoso.com.
To avoid unexpected overload we'll migrate them in batches and for that, we'll need to create custom domains on Azure Frondoor to forward the clients included in those batches to the correct cluster. The batches are composed of 40-50 clients and creating these custom domains one by one would be a pain.
I wrote a bash loop to create the custom domains from a csv file using the following command, which works fine when creating only one domain but it doesn't if I edit it for the loop.
az afd custom-domain create -g rg-test-frontdoor --custom-domain-name client1-contoso-com --profile-name FrontDoor01 --host-name client1.contoso.com --minimum-tls-version TLS12 --certificate-type ManagedCertificate --no-wait
The loop:
#! /bin/bash
while IFS="," read -r domainName domainHost
do
az afd custom-domain create -g rg-test-frontdoor --custom-domain-name $domainName --profile-name FrontDoor01 --host-name $domainHost --minimum-tls-version TLS12 --certificate-type ManagedCertificate --no-wait
echo "Creating: $domainName, $domain"
echo ""
done < <(tail -n +2 domains1.csv)
And my test CSV:
domainName,domainHost
client1-contoso-com,client1.contoso.com
client2-contoso-com,client2.contoso.com
****@****:/mnt/c/scripts/FrondoorCSV$ ./createdomains.sh
Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
'. dRequest) Property 'AfdDomain.HostName' cannot be set to 'client1.contoso.com
Code: BadRequest
'. sage: Property 'AfdDomain.HostName' cannot be set to 'client1.contoso.com
Creating: client1-contoso-com, client1.contoso.com
Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
'. dRequest) Property 'AfdDomain.HostName' cannot be set to 'client2.contoso.com
Code: BadRequest
'. sage: Property 'AfdDomain.HostName' cannot be set to 'client2.contoso.com
Creating: client2-contoso-com, client2.contoso.com
Any ideas on how can I make it work, or a workaround for this massive job?
I'd need something to automate the TXT record to DNS zone but this is in the second plan.
Thank you in advance, Will.
Another option is inside of Teams:
- go to the Files tab of the Team for the file you wish to create a shortcut to.
- click the Show actions dots [...] for the file
- click Open >
- click Open in browser
- If your file opens in Edge
- click the Edge browser options dots [...]
- click Apps
- click Install this site as an app
- either use the default name, or edit to create your preferred file name
- click [Install]
- wait for the file to open
- select your choices for "Allow this app to"
- click [Allow]
- If your file opens in Chrome
- click the Chrome browser options dots
- click More tools >
- click Create shortcut...
- either use the default name, or edit to create your preferred file name
- Chrome has an option to "Open as window"
- Select/check the box will cause the file to open in an "Excel" window
- Leaving the box unchecked will cause the file to open in a Chrome browser window
- click the Chrome browser options dots
You should now have a shortcut directly to the file.
5 Replies
- arnaud_grow-unaBrass Contributor
Hello,WilliamBonomo
Do you have the same issue when you're launching the command manually?
Do you have the same bahavior when you're launching the script with only 1 custom domain?I tried on my side with your script and csv and it works well.
For your information I used a Standard AFD during my testsLet us know.
- WilliamBonomoBrass ContributorCan I also ask you how your CSV looks like?
- arnaud_grow-unaBrass ContributorHello,
Sorry for the delay of my answer.
I used the following configuration:
- VM based on Ubuntu 20.04
- Frond Door Standard pricing tier
The content of my csv file is:
domainName,domainHost
domain1,www.amo02160-1.com
domain3,www.amo02160-3.com
domain5,www.amo02160-5.com
domain7,www.amo02160-7.com
I tried with your csv content and I have no issue to create the domains on my AFD.
Let me know.
- WilliamBonomoBrass ContributorHi,
Thanks for getting back to me.
Yes if I run the command manually it works fine.
Same behavior if running with only one customer domain.
Can I ask you what OS are you using the CLI? I've tried on two different Ubuntu machines.