-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add script to create storage account for storing review photos
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |