Skip to content

Commit d8307e8

Browse files
committed
validation
1 parent 46633da commit d8307e8

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

.azdo/pipelines/azure-dev.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Run when commits are pushed to mainline branch (main or master)
2+
# Set this to the mainline branch you are using
3+
trigger:
4+
- main
5+
- master
6+
- feature/azd-semantickernel
7+
8+
# Azure Pipelines workflow to deploy to Azure using azd
9+
# To configure required secrets and service connection for connecting to Azure, simply run `azd pipeline config --provider azdo`
10+
# Task "Install azd" needs to install setup-azd extension for azdo - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd
11+
# See below for alternative task to install azd if you can't install above task in your organization
12+
13+
pool:
14+
vmImage: ubuntu-latest
15+
16+
steps:
17+
- task: setup-azd@0
18+
displayName: Install azd
19+
20+
# If you can't install above task in your organization, you can comment it and uncomment below task to install azd
21+
# - task: Bash@3
22+
# displayName: Install azd
23+
# inputs:
24+
# targetType: 'inline'
25+
# script: |
26+
# curl -fsSL https://aka.ms/install-azd.sh | bash
27+
28+
# azd delegate auth to az to use service connection with AzureCLI@2
29+
- pwsh: |
30+
azd config set auth.useAzCliAuth "true"
31+
displayName: Configure AZD to Use AZ CLI Authentication.
32+
33+
- task: AzureCLI@2
34+
displayName: Provision Infrastructure
35+
inputs:
36+
azureSubscription: azconnection
37+
scriptType: bash
38+
scriptLocation: inlineScript
39+
inlineScript: |
40+
azd provision --no-prompt
41+
env:
42+
43+
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
44+
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
45+
AZURE_LOCATION: $(AZURE_LOCATION)
46+
# Project specific environment variables
47+
# AZURE_RESOURCE_GROUP: $(AZURE_RESOURCE_GROUP)
48+
# AZURE_AIHUB_NAME: $(AZURE_AIHUB_NAME)
49+
# AZURE_AIPROJECT_NAME: $(AZURE_AIPROJECT_NAME)
50+
# AZURE_AISERVICES_NAME: $(AZURE_AISERVICES_NAME)
51+
# AZURE_SEARCH_SERVICE_NAME: $(AZURE_SEARCH_SERVICE_NAME)
52+
# AZURE_APPLICATION_INSIGHTS_NAME: $(AZURE_APPLICATION_INSIGHTS_NAME)
53+
# AZURE_CONTAINER_REGISTRY_NAME: $(AZURE_CONTAINER_REGISTRY_NAME)
54+
# AZURE_KEYVAULT_NAME: $(AZURE_KEYVAULT_NAME)
55+
# AZURE_STORAGE_ACCOUNT_NAME: $(AZURE_STORAGE_ACCOUNT_NAME)
56+
# AZURE_LOG_ANALYTICS_WORKSPACE_NAME: $(AZURE_LOG_ANALYTICS_WORKSPACE_NAME)
57+
# USE_CONTAINER_REGISTRY: $(USE_CONTAINER_REGISTRY)
58+
# USE_APPLICATION_INSIGHTS: $(USE_APPLICATION_INSIGHTS)
59+
# USE_SEARCH_SERVICE: $(USE_SEARCH_SERVICE)
60+
# AZURE_AI_CHAT_DEPLOYMENT_NAME: $(AZURE_AI_CHAT_DEPLOYMENT_NAME)
61+
# AZURE_AI_CHAT_DEPLOYMENT_SKU: $(AZURE_AI_CHAT_DEPLOYMENT_SKU)
62+
# AZURE_AI_CHAT_DEPLOYMENT_CAPACITY: $(AZURE_AI_CHAT_DEPLOYMENT_CAPACITY)
63+
# AZURE_AI_CHAT_MODEL_FORMAT: $(AZURE_AI_CHAT_MODEL_FORMAT)
64+
# AZURE_AI_CHAT_MODEL_NAME: $(AZURE_AI_CHAT_MODEL)
65+
# AZURE_AI_CHAT_MODEL_VERSION: $(AZURE_AI_CHAT_MODEL_VERSION)
66+
# AZURE_AI_EMBED_DEPLOYMENT_NAME: $(AZURE_AI_EMBED_DEPLOYMENT_NAME)
67+
# AZURE_AI_EMBED_DEPLOYMENT_SKU: $(AZURE_AI_EMBED_DEPLOYMENT_SKU)
68+
# AZURE_AI_EMBED_DEPLOYMENT_CAPACITY: $(AZURE_AI_EMBED_DEPLOYMENT_CAPACITY)
69+
# AZURE_AI_EMBED_MODEL_FORMAT: $(AZURE_AI_EMBED_MODEL_FORMAT)
70+
# AZURE_AI_EMBED_MODEL_NAME: $(AZURE_AI_EMBED_MODEL_NAME)
71+
# AZURE_AI_EMBED_MODEL_VERSION: $(AZURE_AI_EMBED_MODEL_VERSION)
72+
# AZURE_EXISTING_AIPROJECT_CONNECTION_STRING: $(AZURE_EXISTING_AIPROJECT_CONNECTION_STRING)
73+
- task: AzureCLI@2
74+
displayName: Deploy Application
75+
inputs:
76+
azureSubscription: azconnection
77+
scriptType: bash
78+
scriptLocation: inlineScript
79+
inlineScript: |
80+
azd deploy --no-prompt
81+
env:
82+
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
83+
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
84+
AZURE_LOCATION: $(AZURE_LOCATION)

.github/workflows/azure-dev.yml

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

0 commit comments

Comments
 (0)