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, Image flowiseai/flowise, OS type and Size. Then click "Next: Networking" to configure Flowise ports:
Add a new port 3000 (TCP) next to the default 80 (TCP). Then Select "Next: Advanced":
Set Restart policy to On failure. Next, add 2 Environment variables FLOWISE_USERNAME and FLOWISE_PASSWORD. 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"
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 FLOWISE_USERNAME=flowise-user FLOWISE_PASSWORD=flowise-password DATABASE_PATH=/opt/flowise/.flowise APIKEY_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: