Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
78f93e9
Add submodule support in checkout step and set principalId in environ…
Harmanpreet-Microsoft Mar 30, 2026
58f1e44
Add timeout to template validation job and update principalId handling
Harmanpreet-Microsoft Mar 30, 2026
33dd3c2
Add TEMP environment variable and ensure timeout is set for template …
Harmanpreet-Microsoft Mar 30, 2026
08a473b
Configure bicepparam for service principal in template validation wor…
Harmanpreet-Microsoft Mar 30, 2026
480b376
Add submodule support in checkout step of Azure Dev workflow
Harmanpreet-Microsoft Apr 1, 2026
9211252
Add TEMP environment variable to Azure Dev workflow
Harmanpreet-Microsoft Apr 1, 2026
b2524f6
Add support for service principal in Azure Dev workflow
Harmanpreet-Microsoft Apr 1, 2026
4ba6f45
Merge pull request #3 from microsoft/main
Harmanpreet-Microsoft Apr 6, 2026
517abd6
feat: Configure Power BI API permissions for service principal in Azu…
Harmanpreet-Microsoft Apr 6, 2026
aaf5167
feat: Enhance infrastructure provisioning with retry mechanism and fr…
Harmanpreet-Microsoft Apr 6, 2026
ff47a00
feat: Add Power BI API access check before infrastructure provisioning
Harmanpreet-Microsoft Apr 6, 2026
beaaacf
refactor: Remove Power BI API permissions configuration and access ch…
Harmanpreet-Microsoft Apr 6, 2026
6574965
feat: Update AZD environment configuration to set principal type and …
Harmanpreet-Microsoft Apr 6, 2026
6297fe0
feat: Add resource group creation and environment setup in AZD workflow
Harmanpreet-Microsoft Apr 6, 2026
983e5ca
feat: Enhance resource group creation logic to derive name from envir…
Harmanpreet-Microsoft Apr 6, 2026
586e2bd
feat: Add re-authentication and retry logic for infrastructure provis…
Harmanpreet-Microsoft Apr 6, 2026
b365ea2
feat: Add resource group deletion check and retry logic during provis…
Harmanpreet-Microsoft Apr 6, 2026
1c1e6a5
feat: Update fabricWorkspaceMode to 'none' for consistent environment…
Harmanpreet-Microsoft Apr 6, 2026
5e2408e
feat: Remove re-authentication and retry logic from infrastructure pr…
Harmanpreet-Microsoft Apr 6, 2026
a04622d
feat: Remove timeout setting from infrastructure provisioning step
Harmanpreet-Microsoft Apr 6, 2026
195cf60
feat: Refactor principal type and ID handling in workflow and paramet…
Harmanpreet-Microsoft Apr 8, 2026
5d299d5
feat: Remove service principal ID retrieval and AZD environment confi…
Harmanpreet-Microsoft Apr 8, 2026
b2e390a
feat: Add AZURE_PRINCIPAL_ID and AZURE_PRINCIPAL_TYPE to environment …
Harmanpreet-Microsoft Apr 8, 2026
4559409
feat: Enhance Service Principal Object ID resolution logic in workflow
Harmanpreet-Microsoft Apr 8, 2026
cc157d2
feat: Remove Service Principal Object ID resolution step from workflow
Harmanpreet-Microsoft Apr 8, 2026
09ebdeb
Update Azure DevOps workflow for service principal handling
Harmanpreet-Microsoft Apr 8, 2026
d0985cd
Update workflow triggers for AZD template validation
Harmanpreet-Microsoft Apr 9, 2026
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
12 changes: 11 additions & 1 deletion .github/workflows/azd-template-validation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: AZD Template Validation
on:
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'infra/**'
- 'azure.yaml'
- 'scripts/**'
- '.github/workflows/azure-dev.yml'

permissions:
contents: read
Expand All @@ -16,6 +21,8 @@ jobs:
name: azd template validation
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

# This postprovision cleanup step (Stage 19) has been removed from azure.yaml because
# azd down was failing in the pipeline. As a workaround, we are removing this step
Expand All @@ -36,6 +43,9 @@ jobs:
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEMP: /tmp
fabricCapacityMode: 'none'
AZURE_PRINCIPAL_ID: ${{ vars.PRINCIPAL_ID || secrets.AZURE_CLIENT_ID }}
AZURE_PRINCIPAL_TYPE: 'ServicePrincipal'
- name: print result
run: cat ${{ steps.validation.outputs.resultFile }}
53 changes: 50 additions & 3 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,73 @@ jobs:
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
AZURE_USER_OBJECT_ID: ''
AZURE_PRINCIPAL_TYPE: 'ServicePrincipal'
TEMP: /tmp
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install azd
uses: Azure/setup-azd@v2

- name: Azure Developer CLI Login
run: |
azd auth login `
--client-id "$Env:AZURE_CLIENT_ID" `
--federated-credential-provider "github" `
--tenant-id "$Env:AZURE_TENANT_ID"
--tenant-id "$Env:AZURE_TENANT_ID"
shell: pwsh

- name: Azure CLI Login
uses: azure/login@v2
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}

- name: Resolve Service Principal Object ID
run: |
# If PRINCIPAL_ID repo variable is set and is a valid GUID, use it directly
if [[ "${{ vars.PRINCIPAL_ID }}" =~ ^[0-9a-fA-F-]{36}$ ]]; then
echo "Using PRINCIPAL_ID from repo variables"
echo "AZURE_PRINCIPAL_ID=${{ vars.PRINCIPAL_ID }}" >> $GITHUB_ENV
else
# Resolve the Object ID from the Application (Client) ID
# Role assignments require the SP Object ID, not the Client/App ID
echo "Resolving Service Principal Object ID from Client ID..."
SP_OBJECT_ID=$(az ad sp show --id "${{ vars.AZURE_CLIENT_ID }}" --query id -o tsv 2>/dev/null)
if [[ -z "$SP_OBJECT_ID" ]]; then
echo "::error::Failed to resolve Service Principal Object ID from Client ID: ${{ vars.AZURE_CLIENT_ID }}"
exit 1
fi
echo "Resolved SP Object ID: $SP_OBJECT_ID"
echo "AZURE_PRINCIPAL_ID=$SP_OBJECT_ID" >> $GITHUB_ENV
fi

- name: Create Resource Group if needed
run: |
# Use provided RG name or derive from environment name
RESOURCE_GROUP="${AZURE_RESOURCE_GROUP:-rg-${AZURE_ENV_NAME}}"
echo "Using resource group: $RESOURCE_GROUP"

RG_EXISTS=$(az group exists --name "$RESOURCE_GROUP")
if [ "$RG_EXISTS" = "false" ]; then
echo "Creating resource group: $RESOURCE_GROUP"
az group create --name "$RESOURCE_GROUP" --location ${{ vars.AZURE_LOCATION }}
else
echo "Resource group already exists: $RESOURCE_GROUP"
fi

# Set for subsequent steps
echo "RESOURCE_GROUP=$RESOURCE_GROUP" >> $GITHUB_ENV

- name: Provision Infrastructure
id: provision-main
run: azd provision --no-prompt
env:
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
AZURE_PRINCIPAL_TYPE: 'ServicePrincipal'
fabricCapacityMode: 'none'
fabricWorkspaceMode: 'none'
2 changes: 1 addition & 1 deletion infra/main.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param location = readEnvironmentVariable('AZURE_LOCATION', '')
param cosmosLocation = readEnvironmentVariable('AZURE_COSMOS_LOCATION', '')
// Entra object ID of the identity to grant RBAC (user, group, service principal, or UAI). Set this if Graph lookup is blocked.
param principalId = readEnvironmentVariable('AZURE_PRINCIPAL_ID', '')
param principalType = 'User'
param principalType = readEnvironmentVariable('AZURE_PRINCIPAL_TYPE', 'User')

// ========================================
// OPTIONAL INPUTS (Existing Resources)
Expand Down
Loading