Stage 1: Configuring the Azure environment
Many components need to be ready even before we begin to configure the virtual machine and consequently set up the container. You may already have some of these configured so please ignore them as you go through all these. Resource group: Ensure you have configured a resource group so that we can allocate the required Azure resources to it as they are created (this includes the VM!). Click on create to create a resource group, give the resource group a name (I called mine apishtest) and set up the resource group.


Keys: Create a key, by selecting Generate/import and give it a name**. No additional setup is required here.**






Certificates: Now you can finally add your custom certificate to the key vault, which we will use later to provision the gateway. Select Generate/Import to begin the certification configuration.

You have two methods of certification setup, you can either generate a certificate or import a certificate. See the below example for generating a certificate, note the subject field which is important for configuring a CN. Fill in all the required fields that are relevant for your use case.


Once the certificate has been added, we can move to the next stage with is Setting up the Virtual Machine.
Stage 2: Setting up the Virtual Machine








Then move onto the Management section.





Stage 3: Configuring the Virtual Machine and launching the container







Let’s verify the docker install by running the
hello-world image. Use the command below.



Lets now create a folder called “composefiles” and then run the list command to ensure the folder was created.

Navigate to that folder location using
cd composefiles and lets create the docker-compose.yml file. Lets create the file first, then using nano we will add in the basic yaml configuration. 
Once you use
nano you will be presented with a text editor. You can use the basic configuration below for configuring a API Self Hosted instance, however if you want to configure additional parameters you may need to refer to our knowledge-base: /hc/en-us/categories/4405478683545-Draftable-API-Self-hosted

You can write this file by using the shortcut command
Ctrl+O and then exit by using the shortcut command Ctrl+X. Now we need to start Docker, use the command below.
Once you have started docker, we need to install the docker compose plugin so we can use the docker-compose file. Use the commands below.

You will see the container start its boot sequence. Give the container a bit of time to configure and upon successful completion, you should a message saying
Container startup complete.


Navigate back to the virtual machine to retrieve the public IP address. Copy it, and enter it into your browser to connect to the instance.

