IRONSOFTWAREHOME

Deploy a C# Container Instance in Azure

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Use Terraform on Azure to deploy the IronSecureDoc Docker container and make it available with a public IP address and FQDN.

Prerequisites

Step 1: Clone GitHub Repository Template

We have the GitHub Repository template ready for you to clone and get started immediately here:

https://github.com/iron-software/IronSecureDoc-Terraform/
Text

Step 2: Modify All Resource Names

Modify All Resource Names in variables.tf

  • resource_group_name: Name of the resource group.
  • resource_group_location: Location of the resource group. You can find the region from REGIONS.md and use the second column to fill in this variable.
  • container_group_name: Name of the container group.
  • container_name: Name of the container.
  • image_tag: The tag of the image to deploy; it can be latest or any specific version number.
  • Other variables do not need to be changed.

Create secret.tfvars to Contain All Sensitive Data

Populate the following variables in secret.tfvars.

Azure Container Registry

Append to main.tf after dns_name_label = var.dns_name_label:

image_registry_credential {
  server   = var.registry_server
  username = var.registry_username
  password = var.registry_password
}
Text

Add to variables.tf:

variable "registry_server" {
  type        = string
  sensitive   = false
  description = "The server for the container registry. Required if the image is stored in a private registry."
}

variable "registry_username" {
  type        = string
  sensitive   = true
  description = "Username for the container registry. Required if the image is stored in a private registry."
}

variable "registry_password" {
  type        = string
  sensitive   = true
  description = "Password for the container registry. Required if the image is stored in a private registry."
}
Text

Add to secret.tfvars:

registry_server   = "<registry-name>.azurecr.io"
registry_username = "YOUR-REGISTRY-USERNAME"
registry_password = "YOUR-REGISTRY-PASSWORD"
license_key       = "YOUR-LICENSE-KEY"
Text

Docker Hub

Add to secret.tfvars:

license_key = "YOUR-LICENSE-KEY"
Text

Step 3: Initialize Terraform

Run terraform init to initialize the Terraform deployment. This command downloads the Azure provider required to manage your Azure resources.

terraform init -upgrade
SHELL

Step 4: Create a Terraform Execution Plan

Run terraform plan to create an execution plan.

terraform plan -var-file="secret.tfvars" -out main.tfplan
SHELL

Step 5: Apply a Terraform Execution Plan

Run terraform apply to apply the execution plan to your cloud infrastructure.

terraform apply main.tfplan
SHELL

Step 6: Verify the Results

  1. When you apply the execution plan, Terraform outputs the public IP address. To display the IP address again, run terraform output.

    terraform output -raw container_ipv4_address
    SHELL

    Or display the FQDN.

    terraform output -raw container_fqdn
    SHELL
  2. Use Postman or curl to validate. The expected result should return pong.

    curl http://<container_ipv4_address>:8080/v1/document-services/ping
    SHELL

    Or use the FQDN.

    curl http://<container_fqdn>:8080/v1/document-services/ping
    SHELL

Step 7: Destroy the Resource

  • Create an execution plan for destroying the resource.

    terraform plan -destroy -var-file="secret.tfvars" -out main.tfplan
    SHELL
  • Apply an execution destroy plan.

    terraform apply main.tfplan
    SHELL

Frequently Asked Questions

What is the main purpose of deploying IronSecureDoc in Azure using Terraform?

The main purpose is to securely manage and deploy the IronSecureDoc container on Azure, enabling public access through a public IP address and FQDN while ensuring document security.

What are the prerequisites for setting up IronSecureDoc on Azure with Terraform?

To set up IronSecureDoc on Azure with Terraform, you need to install and configure Terraform and authenticate it to Azure using the provided guidelines.

How can I clone the GitHub Repository Template for IronSecureDoc?

You can clone the GitHub Repository Template for IronSecureDoc from the following URL: https://github.com/iron-software/IronSecureDoc-Terraform/.

Which Terraform file should I modify to change resource names for IronSecureDoc deployment?

Modify the `variables.tf` file to change resource names such as resource group name, container group name, and container name for IronSecureDoc deployment.

How should I handle sensitive data for the IronSecureDoc Azure deployment?

Sensitive data should be stored in a `secret.tfvars` file, which includes sensitive variables such as registry server, username, password, and license key, necessary for secure deployment.

How do I use a private registry for storing the IronSecureDoc image in Azure?

To use a private registry, append the image registry credentials block to `main.tf` and add necessary variables in `variables.tf` and `secret.tfvars` to provide registry server, username, and password.

What command initializes the Terraform deployment for IronSecureDoc?

The command `terraform init` initializes the Terraform deployment for IronSecureDoc, downloading the necessary Azure provider.

How can I verify the deployment of the IronSecureDoc container?

You can verify the deployment by running `terraform output` to obtain the public IP or FQDN and using tools like Postman or `curl` to execute a ping, expecting a `pong` response.

What is the process to destroy the IronSecureDoc resources on Azure?

To destroy the resources, create a destroy execution plan with `terraform plan -destroy` and then apply it using `terraform apply` to remove IronSecureDoc resources from Azure.

Can I specify the tag of the IronSecureDoc Docker image during deployment?

Yes, you can specify the tag of the IronSecureDoc Docker image by setting the `image_tag` variable in the `variables.tf` file, using either `latest` or a specific version number.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Version:2024.10just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required