-
Notifications
You must be signed in to change notification settings - Fork 1
/
staticapp.bicep
45 lines (35 loc) · 1019 Bytes
/
staticapp.bicep
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
39
40
41
42
43
44
45
// Params
@description('Enter your GitHub PAT')
@secure()
param token string
@description('In the format of: https://github.com/reponame')
param repositoryUrl string
@description('Which branch in the repo are you deploying from? e.g. main')
param branch string
@description('Where are the app artifacts located? e.g. public')
param appArtifactLocation string
@description('Enter a unique prefix - e.g. mecweb')
param namePrefix string
// Vars
var location = resourceGroup().location
var siteName = '${namePrefix}${uniqueString(resourceGroup().id)}'
var sku = 'Free'
// Create the Static Site
resource staticSite 'Microsoft.Web/staticSites@2020-06-01' = {
location: location
name: siteName
properties: {
buildProperties:{
appArtifactLocation: appArtifactLocation
}
repositoryUrl: repositoryUrl
branch: branch
repositoryToken: token
}
sku:{
name: sku
}
}
// Output
output siteName string = staticSite.name
output siteUrl string = staticSite.properties.defaultHostname