Create an Azion custom domain
Give a workload a free azion.app hostname that Azion serves over HTTPS, from Azion Console, the Azion CLI, or the API.
You can give a workload a free hostname under azion.app from Azion Console, the Azion CLI, or the API. To serve a domain you own, such as www.example.com, refer to Add a custom domain to a workload instead.
The Azion custom domain is a hostname you choose, in the form <your-name>.azion.app, such as my-custom-name.azion.app. It differs from the workload domain, the <id>.map.azionedge.net hostname that Azion generates when it creates the workload. The workload stores the Azion custom domain as one entry of its domains, beside any domain you own. The Azion custom domain is available at no additional cost.
Prerequisites
Console
- A workload on the production infrastructure whose deployment names an application. A staging workload takes no Azion custom domain. To create the workload and its deployment, refer to Workloads quickstart.
- A name that no other workload holds under
azion.app. - Access to Azion Console. For more information, refer to How to access Azion Console.
Add the Azion custom domain to the workload
The workload answers on the Azion custom domain once the full hostname is in its domains. You choose only the name: the suffix .azion.app is fixed.
Console
In Azion Console, the Domains section of the workload form holds the Custom Domain switch, described as “You can use an free azion.app domain.” The Create Workload form carries the same switch and field, so you can also set the name when you create a workload.
To add the Azion custom domain to an existing workload:
Access Azion Console > Workloads.
Select the production workload. Its edit form opens.
In the Domains section, turn on Custom Domain. The Azion Custom Domain field appears.
In Azion Custom Domain, enter the name, such as my-custom-name. The field appends .azion.app.
Select Save.
Azion Console shows “Your workload has been updated”. The workload lists <your-name>.azion.app in its domains.
The API stores the name with the case you send, so My-Site.azion.app reads back as My-Site.azion.app. The change is refused in four cases, each with its own message:
- A second
azion.apphostname on the same workload. A workload holds one, whether the list repeats a name or carries two names:Duplicated usage of suffix in alternate_domains: 'azion.app'. - A name that another workload holds. An
azion.appname belongs to one workload and is not shared between accounts or configurations:The custom hostname is not available. - A wildcard name, such as
*.azion.app:The domain does not conform to the format defined in RFC 1035. - A staging workload. The Console turns off the Custom Domain switch and makes it unavailable, and the CLI and the API return
Custom hostname is not available in the environment 'Staging Infrastructure'.
For the causes and fixes, refer to Troubleshoot Workloads.
Open the Azion custom domain
The Azion custom domain needs no DNS record from you and no certificate of yours. With tls.certificate set to null, the default, the workload serves HTTPS with the Azion SAN certificate, which covers the Azion custom domain and the workload domain. For more information, refer to How Workloads works.
A workload change takes several minutes to reach all of Azion’s distributed infrastructure. Until the change arrives, a request to https://<your-name>.azion.app answers 404 with Azion’s HTML error page. Requests can receive the old or the new configuration for a while, so repeat a request until the answers agree.
Once the change propagates, a request to https://<your-name>.azion.app reaches the application in the workload’s deployment and returns its response, such as 200.