Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bicep format #15

Merged
merged 7 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions .github/workflows/azure-bicep-validate.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate bicep scripts
name: Bicep scripts
on:
workflow_dispatch:
push:
Expand All @@ -13,11 +13,31 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
- name: Checkout PR
if: ${{ github.event_name == 'pull_request'}}
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Checkout branch
if: ${{ github.event_name == 'push'}}
uses: actions/checkout@v2

- name: Azure CLI script
- name: Build Bicep
uses: azure/CLI@v1
with:
inlineScript: az bicep build -f infra/main.bicep

- name: Format Bicep
uses: azure/CLI@v1
with:
inlineScript: az config set bicep.use_binary_from_path=false && az bicep build -f infra/main.bicep
inlineScript: az bicep format -f infra/main.bicep

- name: Add updated Bicep files to commit
uses: EndBug/add-and-commit@v9
with:
message: 'Update Bicep files'
add: '*.bicep'
9 changes: 2 additions & 7 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ param principalId string = ''
@description('Django SECRET_KEY for cryptographic signing')
param djangoSecretKey string


var resourceToken = toLower(uniqueString(subscription().id, name, location))
var tags = { 'azd-env-name': name }

Expand Down Expand Up @@ -53,7 +52,7 @@ module postgresServer 'core/database/postgresql/flexibleserver.bicep' = {
version: '14'
administratorLogin: postgresAdminUser
administratorLoginPassword: postgresAdminPassword
databaseNames: [postgresDatabaseName]
databaseNames: [ postgresDatabaseName ]
allowAzureIPsFirewall: true
}
}
Expand Down Expand Up @@ -83,7 +82,6 @@ module web 'core/host/appservice.bicep' = {
}
}


module appServicePlan 'core/host/appserviceplan.bicep' = {
name: 'serviceplan'
scope: resourceGroup
Expand Down Expand Up @@ -145,7 +143,6 @@ module keyVaultSecrets './core/security/keyvault-secret.bicep' = [for secret in
}
}]


module logAnalyticsWorkspace 'core/monitor/loganalytics.bicep' = {
name: 'loganalytics'
scope: resourceGroup
Expand All @@ -156,8 +153,6 @@ module logAnalyticsWorkspace 'core/monitor/loganalytics.bicep' = {
}
}



output WEB_URI string = 'https://${web.outputs.uri}'
output AZURE_LOCATION string = location
output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name
output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name