-
Notifications
You must be signed in to change notification settings - Fork 5
/
create-az-resources.ps1
38 lines (30 loc) · 1.13 KB
/
create-az-resources.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
param(
[Parameter()]
[ValidateNotNullOrEmpty()]
[string] $AppName = 'auto-scrum-app',
[Parameter()]
[ValidateNotNullOrEmpty()]
[string] $ResourceGroup = 'auto-scrum',
[Parameter()]
[ValidateSet('CentralUS', 'EastAsia', 'EastUS2', 'WestEurope', 'WestUS2')]
[string] $Location = 'CentralUS',
[Parameter()]
[ValidateNotNullOrEmpty()]
[string] $GitHubPat = $null)
If ($null -eq $GitHubPat -or "" -eq $GitHubPat) {
Write-Warning "Required GitHub Personal Access Token."
exit
}
az staticwebapp create \
-n $AppName \
-g $ResourceGroup \
-s https://github.com/<YOUR_GITHUB_ACCOUNT_NAME>/my-first-static-web-app \
-l $Location \
-b main \
--token $GitHubPat
RESOURCE_GROUP_NAME=<your resource group name>
STORAGE_ACC_NAME=<your storage account name>
LOCATION=<Azure region>
az group create -n $RESOURCE_GROUP_NAME -l $LOCATION
az storage account create -n $STORAGE_ACC_NAME -g $RESOURCE_GROUP_NAME -l $LOCATION --sku Standard_LRS
az storage blob service-properties update --account-name $STORAGE_ACC_NAME --static-website --404-document error.html --index-document index.html