Skip to content

Commit 8b17328

Browse files
committed
improve error handling
crash when tryping to create a backup and the storage does (not yet) exist
1 parent 8e94672 commit 8b17328

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Saas.Lib/Deployment.Script.Modules/storage-module.sh

+9
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ function backup-to-azure-blob-storage() {
191191
--level info \
192192
--header "Backup to Azure Blob Storage"
193193

194+
if [[ "${storage_account_name}" == "null" ]] ||
195+
[[ "${container_name}" == "null" ]]; then
196+
echo "Azure Blob Storage or container is not created (null)" |
197+
log-output \
198+
--level error \
199+
--header "Critial error"
200+
exit 1
201+
fi
202+
194203
zip_file_name="${directory}/log-${ASDK_DEPLOYMENT_SCRIPT_RUN_TIME}.zip"
195204

196205
zip -r -j "${zip_file_name}" "${directory}" >/dev/null ||

0 commit comments

Comments
 (0)