From 89716db561751a01e2efd693d1a0693c162d9850 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Tue, 23 May 2023 17:40:05 +0200 Subject: [PATCH] Add azure deployment to pipelines --- server/backend/custom_azure.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/server/backend/custom_azure.py b/server/backend/custom_azure.py index 1621f1c0..910c309e 100644 --- a/server/backend/custom_azure.py +++ b/server/backend/custom_azure.py @@ -5,14 +5,16 @@ from environs import Env env = Env() env.read_env() class AzureMediaStorage(AzureStorage): - account_name = env("IT_AZURE_STORAGE_ACCOUNT") - account_key = env("IT_AZURE_STORAGE_KEY") - azure_container = 'media' - expiration_secs = None + if env("IT_USE_AZURE_BLOB_STORAGE", False): + account_name = env("IT_AZURE_STORAGE_ACCOUNT") + account_key = env("IT_AZURE_STORAGE_KEY") + azure_container = 'media' + expiration_secs = None class AzureStaticStorage(AzureStorage): - account_name = env("IT_AZURE_STORAGE_ACCOUNT") - account_key = env("IT_AZURE_STORAGE_KEY") - azure_container = 'static' - expiration_secs = None + if env("IT_USE_AZURE_BLOB_STORAGE", False): + account_name = env("IT_AZURE_STORAGE_ACCOUNT") + account_key = env("IT_AZURE_STORAGE_KEY") + azure_container = 'static' + expiration_secs = None