Skip to content

Commit 2dfb433

Browse files
Merge pull request #9 from microsoft/AZD
Azd
2 parents 083f2b4 + ea28b52 commit 2dfb433

4 files changed

Lines changed: 120 additions & 38 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "azd-template",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
4+
"forwardPorts": [50505],
5+
"features": {
6+
"ghcr.io/azure/azure-dev/azd:latest": {}
7+
},
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"ms-azuretools.azure-dev",
12+
"ms-azuretools.vscode-bicep",
13+
"ms-python.python",
14+
"ms-toolsai.jupyter",
15+
"GitHub.vscode-github-actions"
16+
]
17+
}
18+
},
19+
"postStartCommand": "git pull origin main && python3 -m pip install -r ./src/frontend/requirements.txt && python3 -m pip install -r ./src/backend/requirements.txt",
20+
"remoteUser": "vscode",
21+
"hostRequirements": {
22+
"memory": "4gb"
23+
}
24+
}

.github/workflows/azure-dev.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Azure Template Validation
2+
on:
3+
# workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
permissions:
8+
contents: read
9+
id-token: write
10+
pull-requests: write
11+
jobs:
12+
template_validation_job:
13+
runs-on: ubuntu-latest
14+
name: Template validation
15+
steps:
16+
# Step 1: Checkout the code from your repository
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
# Step 2: Validate the Azure template using microsoft/template-validation-action
20+
- name: Validate Azure Template
21+
uses: microsoft/template-validation-action@v0.3.5
22+
id: validation
23+
env:
24+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
25+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
26+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
27+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
28+
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
29+
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
# Step 3: Print the result of the validation
32+
- name: Print result
33+
run: cat ${{ steps.validation.outputs.resultFile }}

azure.yaml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
1-
# # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
22

3-
# name: accl-codegeneration-genericaccelerator-1
3+
name: modernize-your-code-solution-accelerator
4+
#KEEP OFF UNTIL WE ARE READY TO PUBLISH ISH
45
# metadata:
56
# template: azd-init@1.13.0
6-
# services:
7-
# backend:
8-
# project: src/backend
9-
# host: containerapp
10-
# language: python
11-
# frontend:
12-
# project: src/frontend
13-
# host: containerapp
14-
# language: python
15-
16-
17-
18-
environment:
19-
name: accl-codegeneration-genericaccelerator-1
20-
location: eastus
21-
name: accl-codegeneration-genericaccelerator-1
22-
metadata:
23-
template: accl-codegeneration-genericaccelerator-1@1.0
24-
25-
parameters:
26-
solutionPrefix:
27-
type: string
28-
default: bs-azdtest
29-
otherLocation:
30-
type: string
31-
default: eastus2
32-
# baseUrl:
33-
# type: string
34-
# default: 'https://raw.githubusercontent.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/'
357

368
deployment:
379
mode: Incremental
38-
template: ./infra/main2.bicep # Path to the main.bicep file inside the 'deployment' folder
39-
parameters:
40-
solutionPrefix: ${parameters.solutionPrefix}
41-
otherLocation: ${parameters.otherLocation}
42-
#baseUrl: ${parameters.baseUrl}
43-
44-
10+
template: ./infra/main.bicep # Path to the main.bicep file inside the 'deployment' folder

infra/main.parameters.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"environmentName": {
6+
"value": "${AZURE_ENV_NAME}"
7+
},
8+
"location": {
9+
"value": "${AZURE_LOCATION}"
10+
},
11+
"backendExists": {
12+
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
13+
},
14+
"backendDefinition": {
15+
"value": {
16+
"settings": [
17+
{
18+
"name": "",
19+
"value": "${VAR}",
20+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
21+
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR} to use the value of 'VAR' from the current environment."
22+
},
23+
{
24+
"name": "",
25+
"value": "${VAR_S}",
26+
"secret": true,
27+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
28+
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR_S} to use the value of 'VAR_S' from the current environment."
29+
}
30+
]
31+
}
32+
},
33+
"frontendExists": {
34+
"value": "${SERVICE_FRONTEND_RESOURCE_EXISTS=false}"
35+
},
36+
"frontendDefinition": {
37+
"value": {
38+
"settings": [
39+
{
40+
"name": "",
41+
"value": "${VAR}",
42+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
43+
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR} to use the value of 'VAR' from the current environment."
44+
},
45+
{
46+
"name": "",
47+
"value": "${VAR_S}",
48+
"secret": true,
49+
"_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.",
50+
"_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR_S} to use the value of 'VAR_S' from the current environment."
51+
}
52+
]
53+
}
54+
},
55+
"principalId": {
56+
"value": "${AZURE_PRINCIPAL_ID}"
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)