Azure
Learn how to deploy Flowise on Azure
Flowise as Azure App Service with Postgres: Using Terraform
Prerequisites
Azure Account: Ensure you have an Azure account with an active subscription. If you do not have one, sign up at Azure Portal.
Terraform: Install Terraform CLI on your machine. Download it from Terraform's website.
Azure CLI: Install Azure CLI. Instructions can be found on the Azure CLI documentation page.
Setting Up Your Environment
Login to Azure: Open your terminal or command prompt and login to Azure CLI using:
az login --tenant <Your Subscription ID> --use-device-code
Follow the prompts to complete the login process.
Set Subscription: After logging in, set the Azure subscription using:
az account set --subscription <Your Subscription ID>
Initialize Terraform:
Create a terraform.tfvars
file in your Terraform project directory, if it's not already there, and add the following content:
subscription_name = "subscrpiton_name"
subscription_id = "subscription id"
project_name = "webapp_name"
db_username = "PostgresUserName"
db_password = "strongPostgresPassword"
flowise_secretkey_overwrite = "longandStrongSecretKey"
webapp_ip_rules = [
{
name = "AllowedIP"
ip_address = "X.X.X.X/32"
headers = null
virtual_network_subnet_id = null
subnet_id = null
service_tag = null
priority = 300
action = "Allow"
}
]
postgres_ip_rules = {
"ValbyOfficeIP" = "X.X.X.X"
// Add more key-value pairs as needed
}
source_image = "flowiseai/flowise:latest"
tagged_image = "flow:v1"
Replace the placeholders with actual values for your setup.
The file tree structure is as follows:
flow
├── database.tf
├── main.tf
├── network.tf
├── output.tf
├── providers.tf
├── terraform.tfvars
├── terraform.tfvars.example
├── variables.tf
├── webapp.tf
├── .gitignore // ignore your .tfvars and .lock.hcf, .terraform
Each .tf
file in the Terraform configuration likely contains a different aspect of the infrastructure as code:
Note: The .terraform
directory is created by Terraform when initializing a project (terraform init
) and it contains the plugins and binary files needed for Terraform to run. The .terraform.lock.hcl
file is used to record the exact provider versions that are being used to ensure consistent installs across different machines.
Navigate to your Terraform project directory and run:
terraform init
This will initialize Terraform and download the required providers.
Configuring Terraform Variables
Deploying with Terraform
Plan the Deployment: Run the Terraform plan command to see what resources will be created:
terraform plan
Apply the Deployment: If you are satisfied with the plan, apply the changes:
terraform apply
Confirm the action when prompted, and Terraform will begin creating the resources.
Verify the Deployment: Once Terraform has completed, it will output any defined outputs such as IP addresses or domain names. Verify that the resources are correctly deployed in your Azure Portal.
Azure Continer Instance: Using Azure Portal UI or Azure CLI
Prerequisites
(Optional) Install Azure CLI if you'd like to follow the cli based commands
Create a Container Instance without Persistent Storage
Without persistent storage your data is kept in memory. This means that on a container restart, all the data that you stored will disappear.
In Portal
Search for Container Instances in Marketplace and click Create:

Select or create a Resource group, Container name, Region, Image source
Other registry
, Image type, Imageflowiseai/flowise
, OS type and Size. Then click "Next: Networking" to configure Flowise ports:

Add a new port
3000 (TCP)
next to the default80 (TCP)
. Then Select "Next: Advanced":

Set Restart policy to
On failure
. Add Command override["/bin/sh", "-c", "flowise start"]
. Finally click "Review + create":

Review final settings and click "Create":

Once creation is completed, click on "Go to resource"

Visit your Flowise instance by copying IP address and adding :3000 as a port:


Create using Azure CLI
Create a resource group (if you don't already have one)
az group create --name flowise-rg --location "West US"
Create a Container Instance
az container create -g flowise-rg \
--name flowise \
--image flowiseai/flowise \
--command-line "/bin/sh -c 'flowise start'" \
--ip-address public \
--ports 80 3000 \
--restart-policy OnFailure
Visit the IP address (including port :3000) printed from the output of the above command.
Create a Container Instance with Persistent Storage
The creation of a Container Instance with persistent storage is only possible using CLI:
Create a resource group (if you don't already have one)
az group create --name flowise-rg --location "West US"
Create the Storage Account resource (or use existing one) inside above resource group. You can check how to do it here.
Inside Azure Storage create new File share. You can check how to do it here.
Create a Container Instance
az container create -g flowise-rg \
--name flowise \
--image flowiseai/flowise \
--command-line "/bin/sh -c 'flowise start'" \
--environment-variables DATABASE_PATH=/opt/flowise/.flowise SECRETKEY_PATH=/opt/flowise/.flowise LOG_PATH=/opt/flowise/.flowise/logs BLOB_STORAGE_PATH=/opt/flowise/.flowise/storage \
--ip-address public \
--ports 80 3000 \
--restart-policy OnFailure \
--azure-file-volume-share-name here goes the name of your File share \
--azure-file-volume-account-name here goes the name of your Storage Account \
--azure-file-volume-account-key here goes the access key to your Storage Account \
--azure-file-volume-mount-path /opt/flowise/.flowise
Visit the IP address (including port :3000) printed from the output of the above command.
From now on your data will be stored in an SQLite database which you can find in your File share.
Watch video tutorial on deploying to Azure Container Instance:
Last updated