Recreating a deployment

Learn how to recreate an existing NGINXaaS for Azure deployment using an Azure Resource Manager (ARM) template.

There are two ways to replicate a current NGINXaaS for Azure deployment using ARM templates. You can either delete and recreate the deployment, or you can update the DNS to smoothly transition to the new deployment.

Prerequisites

Export ARM template from existing deployment

To export an ARM template for an existing deployment:

  1. Navigate to your existing NGINXaaS deployment.
  2. Select Export template under Automation in the left menu.
  3. Wait for the template to generate.
  4. Select Download.
Note:
Any protected files uploaded with your deployment’s NGINX configuration will not be included in the exported ARM template, since ARM does not have access to these.

Delete and recreate strategy

The simplest method to recreate a deployment is to delete the original deployment and then recreate it using the ARM template.

The ARM template generated through the portal will include the VNET and public IP address used by the original deployment as dependencies. If you plan to change these with the new deployment these entries need to be modified in the template.

To recreate the deployment:

  1. Export the template as instructed above.
  2. Modify, if neccessary, and verify the data in the template for accuracy.
  3. Delete the original deployment.
  4. Use the exported ARM template to recreate the deployment using the Azure CLI:
az deployment group create \
    --subscription=<deployment subscription ID> \
    --resource-group=<resource group name> \
    --template-file=<path to template file>

DNS migration strategy

If you control the DNS associated with the deployment’s frontend and have flexibility of the IP address NGINXaaS uses you can recreate a deployment with no downtime.

  1. Export the template, as instructed above.
  2. If you’re using a public IP, create a new public IP resource. If you’re using a private IP address, select a new IP address from your VNET.
  3. Modify the ARM template to change the NGINXaaS deployment name and reference the new IP address.
  4. Use the Azure CLI as above to create a new deployment.
  5. Update DNS to refer to the new deployment’s IP address.
  6. Monitor metrics of the old deployment to watch for requests dropping off as clients use the new IP address from DNS. Note that depending on your DNS settings this could take from a few minutes to a few days.
  7. Delete the old deployment.

Remember to change your configuration on any firewall or Network Security Group associated with the deployment to allow access to your deployment’s new IP address.

Further reading

See the Azure CLI Deployment Create documentation for example commands to create deployment resources.

You can find example code to manage NGINXaaS deployments and related objects in the NGINXaaS GitHub repository, NGINXaaS Snippets.