Hi
I have managed to resolve this issue by adding the environment variable parameter : SUITECRM_DATA_TO_PERSIST with the values âpublic/legacy/config.php public/legacy/config_override.php public/legacy/custom public/legacy/upload public/legacy/themes public/legacy/cache .env.localâ
You have to specify the files and folders that you want to persist.
For info I am deploying V8 to an Azure Container App.
The steps are:
- Create a container app environment
- Create a storage account and Azure File Share
- Mount the file share to the container app environment
- Create an Azure MySQL Flexserver instance and blank database
- Configure the provided YAML with the container app, MySQL and Fileshare info
- Deploy the container app using the YAML
Script used is:
#Set up parameters
SET RESOURCE_GROUP âmy-suitecrm-apps-groupâ
SET ENVIRONMENT_NAME âmy-suitecrm-storage-environmentâ
SET LOCATION âuksouthâ
ECHO $RESOURCE_GROUP
ECHO $ENVIRONMENT_NAME
ECHO $LOCATION
#Create a Resource Group
az group create --name $RESOURCE_GROUP --location $LOCATION --query âproperties.provisioningStateâ
#Create a Azure Container App Environment
az containerapp env create --name $ENVIRONMENT_NAME --resource-group $RESOURCE_GROUP --location â$LOCATIONâ --query âproperties.provisioningStateâ
SET ENVIRONMENT_ID $(az containerapp env show --name $ENVIRONMENT_NAME --resource-group $RESOURCE_GROUP --query âidâ --output tsv)
echo $ENVIRONMENT_ID
Set up a storage account
use a unique random identifier
SET RAND 12345678
SET STORAGE_ACCOUNT_NAME âmyscrmaca$RANDâ
echo âStorage account name isâ $STORAGE_ACCOUNT_NAME
az provider register -n Microsoft.Storage
az provider show -n Microsoft.Storage
az storage account create --resource-group $RESOURCE_GROUP --name $STORAGE_ACCOUNT_NAME --location â$LOCATIONâ --kind StorageV2 --sku Standard_LRS --enable-large-file-share --query provisioningState
#Create a File Share
SET FILE_SHARE_NAME âmysuitecrmfileshareâ
az storage share create --name $FILE_SHARE_NAME --account-name $STORAGE_ACCOUNT_NAME --only-show-errors --output table
SET STORAGE_ACCOUNT_KEY $(az storage account keys list --resource-group $RESOURCE_GROUP --account-name $STORAGE_ACCOUNT_NAME --query â[0].valueâ --output tsv)
echo âStorage Account Key is $STORAGE_ACCOUNT_KEYâ
#Create a storage mount
SET STORAGE_MOUNT_NAME âmysuitecrmstoragemountâ
az containerapp env storage set --access-mode ReadWrite --azure-file-account-name $STORAGE_ACCOUNT_NAME --azure-file-account-key $STORAGE_ACCOUNT_KEY --azure-file-share-name $FILE_SHARE_NAME --storage-name $STORAGE_MOUNT_NAME --name $ENVIRONMENT_NAME --resource-group $RESOURCE_GROUP --output table
#Create AzureDB Flexserver for MySQL
SET DB_SERVER_NAME suitecrm-db-srv-$RAND # Must be globally unique, ie: âSUITECRM-db-srv-â
SET SUITECRM_DB_HOST $DB_SERVER_NAME.mysql.database.azure.com
SET DB_SERVER_SKU GP_Gen5_2 # Azure Database SKU
SET SUITECRM_DB_USER myAdmin # Cannot be âadminâ.
SET SUITECRM_DB_PASSWORD Zx3$RAND # Must include uppercase, lowercase, and numeric
SET SUITECRM_DB_NAME suitecrm_db
az mysql flexible-server create --name $DB_SERVER_NAME --location $LOCATION --resource-group $RESOURCE_GROUP --admin-user $SUITECRM_DB_USER --admin-password $SUITECRM_DB_PASSWORD --output none
#Create a DB
az mysql flexible-server db create --database-name $SUITECRM_DB_NAME --server-name $DB_SERVER_NAME --resource-group $RESOURCE_GROUP --output none
#Turn off SSL
az mysql flexible-server parameter set -g $RESOURCE_GROUP -s $DB_SERVER_NAME -n require_secure_transport -v OFF
az mysql flexible-server parameter show -g $RESOURCE_GROUP -s $DB_SERVER_NAME -n require_secure_transport
#Test connection to DB
az mysql flexible-server connect -n $DB_SERVER_NAME -u $SUITECRM_DB_USER -p $SUITECRM_DB_PASSWORD -d $SUITECRM_DB_NAME
#Enable Azure Services in the Firewall
az mysql flexible-server firewall-rule create --rule-name AllowAllWindowsAzureIps --resource-group $RESOURCE_GROUP --name $DB_SERVER_NAME --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0 --output none
#Create the Container App
#upload yaml file before running this part of the script#
SET CONTAINER_APP_NAME âmy-suitecrm-appâ
az containerapp create -n $CONTAINER_APP_NAME -g $RESOURCE_GROUP --environment $ENVIRONMENT_NAME --yaml suitecrm-aca.yaml
YAML (that needs tailoring) is:
location: uksouth
name: my-suitecrm-app
resourceGroup: my-suitecrm-apps-group
type: Microsoft.App/containerApps
properties:
managedEnvironmentId: /subscriptions/mysubscriptionid/resourceGroups/my-suitecrm-apps-group/providers/Microsoft.App/managedEnvironments/my-suitecrm-storage-environment
configuration:
activeRevisionsMode: Single
dapr: null
ingress:
external: true
allowInsecure: false
targetPort: 8080
traffic:
- latestRevision: true
weight: 100
transport: Auto
registries: null
secrets:
- name: suitecrm-db-name
value: suitecrm_db
- name: suitecrm-db-password
value: Zx312345678
- name: suitecrm-db-user
value: myAdmin
- name: suitecrm-db-host
value: suitecrm-db-srv-12345678.mysql.database.azure.com
service: null
template:
revisionSuffix: ââ
containers:
- image: docker.io/bitnami/suitecrm:latest
name: suitecrm
env:
- name: SUITECRM_DATABASE_NAME
secretRef: suitecrm-db-name
- name: SUITECRM_DATABASE_PASSWORD
secretRef: suitecrm-db-password
- name: SUITECRM_DATABASE_USER
secretRef: suitecrm-db-user
- name: SUITECRM_DATABASE_PORT_NUMBER
value: â3306â
- name: SUITECRM_DATABASE_HOST
secretRef: suitecrm-db-host
- name: BITNAMI_DEBUG
value: âtrueâ
- name: SUITECRM_EMAIL
value: âjohn.dunne@cgi.comâ
- name: SUITECRM_DATA_TO_PERSIST
value: âpublic/legacy/config.php public/legacy/config_override.php public/legacy/custom public/legacy/upload public/legacy/themes public/legacy/cache .env.localâ
resources:
cpu: 2
ephemeralStorage: 8Gi
memory: 4Gi
volumeMounts:
- mountPath: /bitnami
volumeName: mystoragemount
volumes:
- name: mystoragemount
storageName: mysuitecrmstoragemount
storageType: AzureFile
scale:
minReplicas: 1
maxReplicas: 5