Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/azure-bicep-validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Validate bicep scripts
on:
workflow_dispatch:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Run Microsoft Security DevOps Analysis
uses: microsoft/security-devops-action@preview
env:
GDN_TEMPLATEANALYZER_VERBOSE: 1
id: msdo
with:
tools: templateanalyzer

- name: Upload alerts to Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
8 changes: 5 additions & 3 deletions infra/core/host/appservice.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ param tags object = {}
param applicationInsightsName string = ''
param appServicePlanId string
param keyVaultName string = ''
param managedIdentity bool = !empty(keyVaultName)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't make that change in azure-dev yet, raised a discussion


// Runtime Properties
@allowed([
Expand All @@ -33,6 +32,7 @@ param numberOfWorkers int = -1
param scmDoBuildDuringDeployment bool = false
param use32BitWorkerProcess bool = false
param ftpsState string = 'FtpsOnly'
param healthCheckPath string = ''
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is from upstream


resource appService 'Microsoft.Web/sites@2022-03-01' = {
name: name
Expand All @@ -45,11 +45,13 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
linuxFxVersion: linuxFxVersion
alwaysOn: alwaysOn
ftpsState: ftpsState
minTlsVersion: '1.2'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In upstream already

appCommandLine: appCommandLine
numberOfWorkers: numberOfWorkers != -1 ? numberOfWorkers : null
minimumElasticInstanceCount: minimumElasticInstanceCount != -1 ? minimumElasticInstanceCount : null
use32BitWorkerProcess: use32BitWorkerProcess
functionAppScaleLimit: functionAppScaleLimit != -1 ? functionAppScaleLimit : null
healthCheckPath: healthCheckPath
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In upstream

cors: {
allowedOrigins: union([ 'https://portal.azure.com', 'https://ms.portal.azure.com' ], allowedOrigins)
}
Expand All @@ -58,7 +60,7 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
httpsOnly: true
}

identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
identity: { type: 'SystemAssigned' }
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undecided managedIdentity change


resource configAppSettings 'config' = {
name: 'appsettings'
Expand Down Expand Up @@ -93,6 +95,6 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing
name: applicationInsightsName
}

output identityPrincipalId string = managedIdentity ? appService.identity.principalId : ''
output identityPrincipalId string = appService.identity.principalId
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undecided managedIdentity change

output name string = appService.name
output uri string = 'https://${appService.properties.defaultHostName}'
4 changes: 2 additions & 2 deletions infra/core/host/container-app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ param name string
param location string = resourceGroup().location
param tags object = {}

param containerAppsEnvironmentName string = ''
param containerAppsEnvironmentName string
param containerName string = 'main'
param containerRegistryName string = ''
param containerRegistryName string
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PR

param env array = []
param external bool = true
param imageName string
Expand Down
6 changes: 3 additions & 3 deletions infra/core/host/container-apps.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ param name string
param location string = resourceGroup().location
param tags object = {}

param containerAppsEnvironmentName string = ''
param containerRegistryName string = ''
param logAnalyticsWorkspaceName string = ''
param containerAppsEnvironmentName string
param containerRegistryName string
param logAnalyticsWorkspaceName string
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PR


module containerAppsEnvironment 'container-apps-environment.bicep' = {
name: '${name}-container-apps-environment'
Expand Down
1 change: 0 additions & 1 deletion infra/core/host/functions.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ module functions 'appservice.bicep' = {
keyVaultName: keyVaultName
kind: kind
linuxFxVersion: linuxFxVersion
managedIdentity: managedIdentity
Copy link
Owner Author

@pamelafox pamelafox Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my own change to appservice.bicep

minimumElasticInstanceCount: minimumElasticInstanceCount
numberOfWorkers: numberOfWorkers
runtimeName: runtimeName
Expand Down
2 changes: 1 addition & 1 deletion infra/core/security/keyvault-access.bicep
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param name string = 'add'

param keyVaultName string = ''
param keyVaultName string
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PR

param permissions object = { secrets: [ 'get', 'list' ] }
param principalId string

Expand Down