Creating an Edge Application using Azion CLI

This guide presents the steps for creating an edge application using the Azion CLI commands.

Requirements: Before starting to build your edge application, you need to:

  • Download and install the Node.js JavaScript runtime compatible with your operating system from the official website. This installation includes the npm package manager.
  • Download and install the Azion CLI, version 0.46.0 or higher, as shown in the topic Installing.
  • Create a personal token in Real-Time Manager and configure it in CLI. See the Authorization on the Azion Platform documentation.

To create an edge application using the CLI with the JavaScript template, follow these steps:

  1. Start a Node.js project in your application folder with the command npm init -y.

  2. Create a file called index.js with the application code.

  3. Run the command:

    azioncli edge_applications init --name "my-app" --type javascript

  4. Run the command:

    azioncli edge_applications build

  5. Run the command:

    azioncli edge_applications publish

The CLI response will be similar to the example below:

Building your edge Application

Your edge Application was built successfully Created Edge Function my-app with ID 1909 Created Edge Application my-app with ID 123456789 Created Domain my-app with ID 123456789 Your edge Application was published successfully

To visualize your application access the domain:

Content is being propagated to all Azion POPs and it might take a few minutes for all edges to be up to date

  1. Use the URL that appears at the end of the message in step 5 to open your edge application in your Internet browser.

Note: publishing an edge application via RTM or CLI isn’t an instantaneous process. There is a time to propagate and configure the application in Azion’s edge locations. It may be necessary to wait a few minutes for the URL to be activated and the application page to be effectively displayed in the browser.

Browse RTM to view the new elements that the CLI commands created in this guide.

Tip: if you want to retrieve your application’s URL, on Real-Time Manager, select Products Menu > Domains. You’ll see a list of your domains, including the one created by the CLI commands in this guide.