Workloads quickstart
Create a workload, bind your application to it with a deployment, and send your first request through its workload domain.
This guide instructs you through serving your application from your first workload.
- Create a workload on the production infrastructure.
- Bind the application you already have to the workload through its deployment.
- Send a request to the workload domain and get your application’s response.
Four objects carry a request to your application, and each one links to the next:
- The workload receives the traffic. Azion gives it a workload domain, a hostname of the form
<id>.map.azionedge.net. The workload answers on it before you own or point any domain. - The deployment of the workload names the application that answers. A workload holds one deployment.
- The application handles the request. It already exists, and the workload adds nothing to it.
- The request to the workload domain reaches the workload, and the deployment sends it to your application.
A workload with no deployment has no application to send a request to. An application serves no traffic until a deployment binds it to a workload. This guide keeps the defaults of a new workload: the production infrastructure, the default TLS settings, ports 80 and 443, and no domain of your own.
The workload this guide leaves you with is the starting point for two more quickstarts. With Certificate Manager, you bind a certificate to the workload. With Custom Pages, you assign a custom page set in the workload’s deployment to replace error responses. DDoS Protection needs no setup: the Platform mitigates DDoS attacks on every workload.
Prerequisites
Console
- An Azion account. To create one, refer to Create an account.
- An application that serves content. To create one, refer to Applications quickstart.
- Access to Azion Console. To sign in, refer to How to access Azion Console.
Create the workload
A new workload runs on the production infrastructure and answers on its workload domain. The infrastructure is fixed once the workload exists. A workload created on staging cannot move to production later. The workload domain stays reachable while Workload Domain Allow Access is on, which is the default.
Console
In Azion Console, one form creates the workload and its deployment together. The Application field of Deployment Settings names your application before you select Create.
To create the workload in Azion Console:
Access Azion Console > Workloads.
Select Create Workload. The Create Workload page opens.
Enter a name for the workload, such as my-workload.
In Infrastructure, select Production Infrastructure (All Edge Locations).
In Domains, keep Workload Domain Allow Access turned on.
In Deployment Settings, select your application in Application. Leave Firewall and Custom Page empty.
Azion Console shows the message “Your Workload has been created. After propagation the domain will be available in the Workload URL. You also can add a custom domain.” To copy the workload domain that you send the request to, select Copy Workload URL. The workload exists, and its deployment names your application.
Bind your application
The deployment of a workload names the application that answers its requests, and optionally a firewall and a custom page set. A workload holds one deployment, and a second one is refused. Until the deployment names your application, the workload has nothing to send a request to.
Console
The Create Workload form already created the deployment. To check the binding in Azion Console:
Access Azion Console > Workloads.
Select the workload you created. The Edit Workload page opens.
In Deployment Settings, check that Application shows your application.
The deployment of the workload names your application.
Send a request to the workload domain
The check is the same whichever interface created the workload. In the commands, replace <your-workload-domain> with the workload domain of the workload you created, of the form <id>.map.azionedge.net.
A new workload does not answer at once. Its deployment spreads across Azion’s distributed infrastructure, and that takes several minutes, with no guaranteed duration. Until then, the workload domain answers 404 with Azion’s HTML error page. While the deployment spreads, answers to the same request can alternate between that 404 and your application’s response. Repeat the request until your application answers. For more information, refer to Propagation.
Before the deployment propagates, a header-only request gets Azion’s error page:
The x-azion-request-id header identifies the request. Once the deployment answers, send a request to the root path of your workload domain:
The response is the one your application returns for /: its status, its headers, and its body. Your workload serves your application on its workload domain.