Skip to content

Commit

Permalink
feat: add script to create storage account for storing review photos
Browse files Browse the repository at this point in the history
Related-work: #6
  • Loading branch information
Christian Fosli committed Oct 23, 2022
1 parent 255e0d6 commit 2b4da1d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/az-create-storage-account.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -eo pipefail

if [[ -z "$1" ]] || [[ "$1" == "--help" ]]
then
printf 'Usage: %s {env}\n\t{env}=dev|prod\nPrereq: Log in to azure CLI and choose the correct subscription\n' "$0"
exit 1
fi

env="$1"

az storage account create -n "ststellerom${env}" -g "rg-stellerom-${env}" \
-l norwayeast \
--min-tls-version TLS1_2

if [[ "$env" == prod ]]
then
origin="www.stellerom.no"
else
origin="$env.stellerom.no"
fi

az storage cors add --methods GET --origins "$origin" --services b --account-name "ststellerom${env}"

0 comments on commit 2b4da1d

Please sign in to comment.