Skip to content

Commit

Permalink
Add CORS Rules to Bicep (#1345)
Browse files Browse the repository at this point in the history
* setup cors in bicep

* limit allowed origins

* Update infra/main.bicep

---------

Co-authored-by: Matt Wicks [SSW] <wicksipedia@users.noreply.github.com>
  • Loading branch information
Aibono1225 and wicksipedia committed May 14, 2024
1 parent 697a084 commit f23dd2e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-06-01' = {
}
}

resource blobServices 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
name: 'default'
parent: storageAccount
properties: {
cors: {
corsRules: [
{
allowedHeaders: [
'*'
]
allowedMethods: [
'GET'
'HEAD'
'OPTIONS'
]
allowedOrigins: [
'https://ssw.com.au'
'https://www.ssw.com.au'
]
exposedHeaders: [
'*'
]
maxAgeInSeconds: 86400
}
]
}
}
}

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: 'DeploymentScript'
location: location
Expand Down

0 comments on commit f23dd2e

Please sign in to comment.