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

Add Bicep validation workflow #444

Closed
wants to merge 5 commits into from
Closed
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
34 changes: 34 additions & 0 deletions .github/workflows/azure-dev-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Validate AZD template
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build Bicep for linting
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
GDN_TEMPLATEANALYZER_ANALYZETEMPLATE: infra/main.bicep
GDN_TEMPLATEANALYZER_PARAMETERSFILEPATH: .github/workflows/test.parameters.json
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 }}
57 changes: 57 additions & 0 deletions .github/workflows/test.parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"environmentName": {
"value": "azd-openai"
},
"location": {
"value": "eastus"
},
"openAiResourceGroupLocation": {
"value": "eastus"
},
"principalId": {
"value": "${AZURE_PRINCIPAL_ID}"
},
"openAiServiceName": {
"value": "${AZURE_OPENAI_SERVICE}"
},
"openAiResourceGroupName": {
"value": "${AZURE_OPENAI_RESOURCE_GROUP}"
},
"openAiSkuName": {
"value": "S0"
},
"formRecognizerServiceName": {
"value": "${AZURE_FORMRECOGNIZER_SERVICE}"
},
"formRecognizerResourceGroupName": {
"value": "${AZURE_FORMRECOGNIZER_RESOURCE_GROUP}"
},
"formRecognizerSkuName": {
"value": "S0"
},
"searchServiceName": {
"value": "${AZURE_SEARCH_SERVICE}"
},
"searchServiceResourceGroupName": {
"value": "${AZURE_SEARCH_SERVICE_RESOURCE_GROUP}"
},
"searchServiceSkuName": {
"value": "standard"
},
"storageAccountName": {
"value": "${AZURE_STORAGE_ACCOUNT}"
},
"storageResourceGroupName": {
"value": "${AZURE_STORAGE_RESOURCE_GROUP}"
},
"chatGptDeploymentName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
},
"gptDeploymentName": {
"value": "${AZURE_OPENAI_GPT_DEPLOYMENT=davinci}"
}
}
}
1 change: 1 addition & 0 deletions infra/core/host/appservice.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
appCommandLine: appCommandLine
numberOfWorkers: numberOfWorkers != -1 ? numberOfWorkers : null
minimumElasticInstanceCount: minimumElasticInstanceCount != -1 ? minimumElasticInstanceCount : null
minTlsVersion: '1.2'
use32BitWorkerProcess: use32BitWorkerProcess
functionAppScaleLimit: functionAppScaleLimit != -1 ? functionAppScaleLimit : null
healthCheckPath: healthCheckPath
Expand Down