Deploy the Assembler in Microsoft Azure (Terraform)
This guide is only for V2 assemblers being deployed with a virtual machine in Microsoft Azure by using Terraform. The V1 assembler is no longer supported as of June 30, 2024.
Each assembler you created must be deployed via a virtual machine, and then you can add your technology as a security device in Workbench to complete the full integration. For more information about the Expel Assembler or how it works, see the About the Expel Assembler guide.
Prerequisites
You must have completed all of the steps in Add a New Assembler for each assembler you wish to deploy.
You must extract the Fedora CoreOS image file you downloaded. You will need to upload the .vhd file, not the compressed .xz file, to use Terraform.
Make sure your network security group (for your firewall configuration) is in a resource group, and that you know which group it is. You will need to place the storage account, blob storage container, image, and virtual machine from this guide in that same resource group.
You must have Terraform installed.
Step 1: Download the Ignition File
The ignition file enables the virtual machine to read a configuration file, and to provision the Fedora CoreOS system based on the contents of that file. You will use this file when you configure the virtual machine in GCP.
In the side menu, navigate to Organization Settings > Assemblers.
Find the assembler you created, leave the file format as JSON, and select Download the CoreOS Ignition File. This action will download a JSON file that you will need in the next section.

Move your ignition file to a remote, secure location such as Google's Cloud Storage. The contents of the ignition file will be stored in plaintext (unencrypted) wherever your Terraform state files are located.
Repeat this process for any additional assemblers.
Step 2: Install and Log In via the Azure CLI
You must authenticate Terraform with your Azure account. The first step is to get the CLI and log into your Azure account.
Log into Azure via the CLI. This command will open a browser window and have you log in there (look for a successful login message in your browser, then go back to Terminal):
Terminal will retrieve and return your subscription and tenant information. Follow the instructions to select your subscription and tenant.
Step 3: Set Up the Terraform Config File
You need to set up the config file so that Terraform uses the Azure provider to configure your infrastructure.
Create a Terraform config file, if you do not have one already.
Add the following configuration to your Terraform config file:
Step 4: Prepare the Resource Definitions File
You need a resource definitions file to hold your Terraform resources, SAS token, custom data, network, internal subnet, and internal network interface.
Create a resource definitions file, if you do not have one already.
Do one of the following:
If you do not have an existing storage account and blob storage container, and need to create them, continue to Step 5: Create an Azure Storage Container.
If you already have an existing storage account and blob storage container you want to use, and it is within the resource group that contains your network security group, skip to Step 6: Upload the Ignition File and CoreOS File.
Step 5: Create an Azure Storage Container
If you are deploying more than one assembler, you may use the same resources as long as all assemblers are in the same location.
To create these two resources quickly, add the following block to your resource definitions file.
Make sure to use the resource group that contains your network security group and firewall configuration for
YOUR_RESOURCE_GROUP_NAME.Make sure your
locationmatches the location of your virtual machine. In this example, we have set the value to "East US".You may use any name you like for your storage account (
YOUR_STORAGE_ACCOUNT_NAME) and blob storage container (YOUR_STORAGE_CONTAINER_NAME).
Deploy your new Terraform resources.
Run
terraform initto initialize the working directory.Run
terraform planand review the changes.If the plan looks right, run
terraform applyand confirm the actions.
Step 6: Upload the Ignition File and CoreOS File
Your CoreOs image file and ignition file (stored in its remote location) can now be uploaded to your new container through the Azure portal.
Select Storage Accounts.
Select the storage account you created in the previous section, or that you already have and want to use.
Select Upload.
In the Upload blob window:
Drag-and-drop or browse for the .vhd file. Do not upload the compressed .xz file.
Find and select the container you created in the previous step, or that you already have and want to use.
Leave all Advanced settings as is.
Select Upload.
Drag and drop or browse for the ignition file.
Verify you are still in the same container.
Leave all Advanced settings as is.
Select Upload.
Repeat this process for any additional assemblers that are using that container.
Close the window.
Step 7: Create a Managed Image in Azure
You must create a managed image that can be used for the Linux virtual machine.
Still in the Azure portal, search for or select Images.
Select Create.
On the Create an image screen:
Subscription - select the subscription you want to use.
Resource group - select the resource group that contains your network security group; this is the same resource group that you chose to hold your storage container.
Name - enter a name for the image, such as "assemblercoreosimage".
Region - select the region for your resource group.
Zone resiliency - leave unchecked.
OS type - select Linux.
VM generation - select Gen 1.
Storage blob - use the Browse link to select the storage account you created in Step 5, then select the storage container, then select the .vhd file, then choose Select.
Account type - select Standard SSD.
Host caching - select Read/write.
Key management - select Platform-managed key.
Data disk - do not add a data disk.
Select Review + Create.
Review your configuration if desired, then select Create.
Before you move to the next step, you must obtain the URI for the image file (you will need it later in this guide). To do so:
From your list of images, select the image you just uploaded.
While viewing the image's Overview page, copy the full URL out of your browser and into a text editor.
Select the portion of the URL from “/subscriptions” all the way to the name of the image, and leave out “/overview” at the end. Save this portion as your image file's URI.
Step 8: Create a Shared Access Signature (SAS) for the Ignition File Blob
To give CoreOS the ability to remotely access the ignition file from your Azure storage container, you must provide a link to the file.
Add the following block to your resource definitions file to create your SAS.
If you are using a pre-existing storage account that is not hosted by Terraform, be sure to update the
primary_connection_stringattribute accordingly.If you need help finding the string in your Azure portal, follow the steps in this Microsoft Help Forum topic.
Step 9: Create the Custom Data via Terraform’s Template_File Source
This step creates the file used in a later step’s custom_data resource attribute.
Add the following block to your resource definitions file to create your custom data.
Be sure to replace
NAME-OF-BLOBwith the file name of the storage blob for your ignition file.
Step 10: Configure Your VM's Network Infrastructure
This Terraform block creates a network, an internal subnet, and an internal network interface for use by the Assembler's virtual machine. Add it to your resource definitions file and be sure to specify your own:
Network name (
YOUR_NETWORK_NAME)Internal subnet name (
YOUR_SUBNET_NAME)Internal network interface name (
YOUR_NETWORK_INTERFACE_NAME)
Step 11: Configure and Spin Up the Virtual Machine
A few notes about this block:
The
sizeis “Standard_D2_v31”, which has the minimum CPU and RAM requirements for an assembler.The
disk_size_gbis 20, which indicates the 20GB minimum disk size required for an assembler.The
admin_username,username, andadmin_ssh_keyhave been filled in for you. The Azure Terraform Provider requires values in these fields, but they will be overwritten by the Assembler bootup sequence.
To configure your virtual machine:
Add the following block to your resource definitions file. This will instruct the azurerm_linux_virtual_machine resource to configure your virtual machine with the minimum requirements. Make sure to:
Use a unique
namefor each assembler. If you are just deploying one assembler, you can leave the name value as "assembler".Add your image URI (from Step 7) as the
source_image_id.
Deploy your Terraform resources.
Run
terraform initto initialize the working directory.Run
terraform planand review the changes.If the plan looks right, run
terraform applyand confirm the actions.
Step 12: Verify a “Connected” Status in Workbench
In the side menu, navigate to Organization Settings > Assemblers (or, refresh the page if you never logged out).
Find your newly created assembler(s) and verify that the status has changed from “Not Yet Connected” to “Connected.”
If your assembler(s) still do not show as connected after waiting at least 15 minutes and refreshing the page, see the Troubleshooting section for help.
Step 13: Connect Your Technology
You can now set up your vendor technology in Workbench.
Troubleshooting
If your assembler is still not showing as “Connected” after 15 minutes:
Make sure your chosen connection has the proper firewall configurations to allow our outbound ports.
Make sure your config file includes the correct region (Step 3).
Make sure your ignition file is at the path specified, and that you are referencing the correct ignition file for your assembler (Step 1).
Make sure your chosen machine’s size meets the required minimums (2 virtual CPUs, 8 GB RAM, and 20 GB disk space).
Make sure the login credentials you obtained for the assembler are for a user who has admin permissions in Workbench.
If Boot Diagnostics are available on the machine, go to the assembler’s virtual machine page in the Azure Portal and select Help. Then select Boot Diagnostics to see a screenshot of the serial console. Or, connect to the serial console by selecting Serial Console and entering your assembler’s customer credentials (this requires Workbench admin access). These places may help diagnose the problem.
If all firewall, config file, and resource definitions settings are correct and you are still unable to connect the assembler, contact Support for help.
Reference
Full Code Examples
Last updated
Was this helpful?

