All components, i.e., Strapi & MySQL, run on a single VM; hence it is ideal for getting started, exploring Strapi, or a sandbox scenario.
Azure ARM templates are a way to implement infrastructure as code in Azure. Infrastructure as code's benefits includes deployment automation, consistent and repeatable infrastructure, and agility.
This guide uses an ARM (Azure Resource Manager) template to deploy the required Azure resources and a bash script to configure and install Strapi in it. You can do this with minimal user intervention.
The template creates the following required resources in its own new Resource Group:
Strapi installation steps run using a bash script after the VM provisioning. The script is part of the repository that contains the ARM template.
The ARM template (JSON file) and the bash script are available on the GitHub repo.
Azure Defaults
Parameter | Value | Description |
---|---|---|
adminUsername | strapiadmin | Username for connecting (SSH) to the Azure VM |
adminPasswordOrKey | $tr@p!@12345 | Default password for the user |
Strapi Defaults
A Strapi app called blog is created with the following defaults.
Parameter | Value |
---|---|
NODE_ENV | development |
DB_HOST | localhost |
DB_PORT | 3306 |
DB_NAME | strapi_dev |
DB_USER | strapi |
DB_PASS | mysecurepassword |
JWT_SECRET | aSecretKey |
NOTE: This template has been deliberately created so that it requires the least possible inputs to get a working Strapi installation. Hence, many variables have been pre-defined as per minimum requirements. You can edit the ARM template if you wish to modify any variables, such as Azure VM size or password(s).
Running this Azure deployment as it is in Production is not recommended.
While it is not mandatory but a basic understanding of the following will help if you wish to customize this template or the script
Click the Deploy to Azure button below to load the template in Azure Portal. You may be prompted to sign in to Azure.
In the custom deployment page, click Create new and create a new Resource Group for this deployment.
Next, select your preferred Region and then click Review + create.
Ensure Validation passes , click Create to start the Azure resource deployment.
The deployment process will begin and take around 5-10 minutes. NOTE: If the deployment fails, delete the resource group completely and restart the deployment. Do not use the Redeploy feature.
You can also retrieve this & the Public IP address from the Overview section of the Azure VM.
You can modify the default values of the Azure infrastructure to your need. The following values could be changed (avoid changing other values, such as for networking and DNS, unless you are sure of the expected outcome):
After clicking Deploy to Azure, click Edit template.
Modify values as needed.
Click Save.
Continue with deployment.
The installation uses some default values for database username, password, port, database name, etc. As mentioned earlier in the article, one can modify them after the installation if needed.
Refer to the documentation for instructions.
This article demonstrates how to quickly bring up an Azure VM running Strapi using an ARM template or Infrastructure as Code approach.
Multi-cloud professional with over 17 years of technology experience, primarily in the Cloud Computing, Virtualization & Datacenter domains. Multi-cloud certified since 2013 and a Microsoft Certified Trainer since 2015.