---
title: "Deploying Containers on Azure"
slug: "deploying-containers-on-azure-1"
tags: ["containers"]
updated: 2024-05-30T08:55:00Z
published: 2024-05-30T09:00:06Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying Containers on Azure

Two or more containers cannot be started at the same time.For containers running on a new database, start only one first so it may set up the database, After that, start other containers one at a time.  

---

## Overview

Users may deploy Azure [containers](/v9/docs/containers-overview) via the following methods:

- With a template .json file
- Without a template file
- With a .yaml file in Azure CLI

It is recommended to also set up [Azure Log Analytics](/v9/docs/setting-up-azure-log-analytics-for-integration-with-decisions) for the new Azure containers to better organize their logs.

### Prerequisites

- Existing Azure SQL server and SQL database.
- Existing [Azure storage accoun](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal)t with the following [SMB file shares](https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-create-file-share?tabs=azure-portal#create-a-file-share) (1TB capacity recommended) and "logs" (100GB capacity recommended).

---

## Deploying with a Template File

A template file can help speed up container deployment by providing a base structure for container configuration that can then be edited to fit specific connection needs.

Utilize the provided template.

### Editing the Template

To successfully connect, edit this template with the corresponding values.

The template can be edited before or during container creation; however, it is recommended to edit before creation in a text editor such as Notepad++ to view all available settings.

[Azure_Container_Deployemnt(1).JSON](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/Azure_Container_Deployemnt(1).JSON)

Change the following template parameters:

| Parameter Name | Default Value | Desired Value |
| --- | --- | --- |
| name | decisions | Replace with the desired name to give to the container. |
| location | [resourceGroup().location] | Specify the location for the container deployment. Refer to [Azure geographies](https://azure.microsoft.com/en-us/explore/global-infrastructure/geographies/#overview). |
| image | decisionscore/platform:latest | Container images for all Decisions version 8.0 and further have been published to [Docker Hub](https://hub.docker.com/r/decisionscore/platform/tags) and are publicly available. Just change the version number as per requirement. |
| port | 80 | Enter the desired port number. |
| cpuCores | 4 | Mention the number of CPU cores. |
| memoryInGb | 16 | Mention the memory to be allocated to the container. |

Change the following **environment variables**:

For more information on environment variables, refer to [Environment Variables](https://documentation.decisions.com/v9/docs/environment-variables).

| Variable Name | Default Value | Desired Value |
| --- | --- | --- |
| DECISIONS_DATABASECONNECTSTRING | -- | Change the Database Connection String based on the database type. For a supported database, refer to [Database Server Configuration](https://documentation.decisions.com/v9/docs/installation-requirements?highlight=Database%20Server%20and%20Configuration). |
| DECISIONS_DATABASETYPE | Azure | Replace with the name of the Azure SQL database to connect to this container. |
| DECISIONS_PORTALBASEURL | {Domain_Name} | Replace with the Domain Name of the Server if assigned. |
| TZ | US/Eastern | Replace this with the desired time zone |

Volume Mount:

| Parameter Name | Default Value | Desired Value |
| --- | --- | --- |
| name | azurefilestorage | Replace with the name of the desired Azure Storage Account. |
| shareName | filesharename | Replace with the name of the desired File Share created under Azure Storage Account |
| storageAccountName | azurefilestorage | Replace with the name of the desired Azure Storage Account. |
| storageAccountKey | -- | Enter the Storage Account Key. |

### Container Setup

1. After editing the template, open the Azure portal. Select **Create a resource**(plus icon).![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1644955019263.png)
2. In the Marketplace, search for "Template deployment".**![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1644955062861.png)**
3. For Plan, select **Template Deployment (deploy using custom templates)**. Select Create.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1649869061346.png)
4. Click **Build your own template in the editor**.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1644955105492.png)
5. Once opened, copy and paste the template .json file provided into the text editor. Review the .json for accuracy and edit the template if necessary. Select **Save**once done.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1649869931497.png)
6. In the Project Details window, select the desired resource group from the **Resource Group** drop-down menu.
7. Under **Instance Details**, verify and/or edit the values using the above tables as reference. Select **Review + Create**once done.Not all settings present in the .json are displayed on this page.To go back and edit any other settings, select **Edit Template**at the top of the page to return to the in-browser text editor. Once edits are complete, select Save to return to this page.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1684998587212.png)
8. Azure runs a validation check to check for errors. If validation fails, Azure provides details on where the .json file is producing the error. Select **Basics**to return to editing. This is the last opportunity to make any changes.  
Once validation passes, select **Create**to commence container creation.
9. Azure then attempts to deploy the container. This may take several minutes. Once deployment is complete, select **Go to Resource**to view the container. Its status should be **Running**. For more information, refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/container-instances/container-instances-quickstart-template#review-deployed-resources) to review the deployed resources.

---

## Deploying without a Template File

This method lacks volume mapping for the container within Azure.Volume must be manually mapped after a successful deployment. Deploying without a template is only recommended when testing since data in this container cannot be persisted and volume cannot be mapped.

1. Navigate to **All Services** and search for **Container instances**in the Azure portal. Select Container instances.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1644955175928.png)
2. Select or create the resource group for the container.
3. Specify the container name.
4. Under Image source, select [**Docker hub**](https://hub.docker.com/r/decisionscore/platform/tags)**or other registries.**Enter the **image name** into the **Image** field with the included tag. It is recommended to use decisionscore/platform:latest to pull the latest version.
5. Change the OS type to **Linux** with the recommended size to be 4vcpu with 16GB of memory.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1646667288857.png)
6. In the Advanced Tab, enter and define [both the required and any optional environment variables](https://documentation.decisions.com/v9/docs/environment-variables).
7. Once finished, review and create the container.

---

## Deploying with Azure CLI

Azure also supports configuring a container via a yaml file. For further information, refer to Microsoft's article [YAML Reference: Azure Container Instances.](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-reference-yaml)

1. Create a .yaml or use the example file below:[[Article Example] Decisions Azure Container CLI.yaml](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/%5BArticle%20Example%5D%20Decisions%20Azure%20Container%20CLI.yaml)  

If using the template, check all values and then edit where needed for different port numbers, resource values, log folder names, etc.
2. Open Azure CLI via Azure Cloud Shell. Switch the language to **Bash.**
3. Upload the yaml file by selecting the **Upload/Download Files**button (document with arrows icon).  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1650985392625.png)
4. Edit the capitalized values, then run the yaml with the following command:

```shell
az container create --resource-group RESOURCEGROUPNAME --name CONTAINERNAME --file FILENAME.yaml]
```
5. The new container will deploy based on the yaml's configuration. This may take several minutes. Once deployment is complete, select **Go to Resource**to view the container. Its status should be **Running**.

---

## Adding Custom Modules

Due to a limitation with dot notation within Azure, the CustomModules\LocalModule folder needs to be volume mapped before copying custom DLLs for modules into this folder. Visit Microsoft's article on [Mapping Volumes in Azure](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files).
