File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 tenant-id : ${{ vars.AZURE_TENANT_ID }}
4949 subscription-id : ${{ vars.AZURE_SUBSCRIPTION_ID }}
5050
51+ - name : Resolve Service Principal Object ID
52+ run : |
53+ # Use explicit PRINCIPAL_ID if set, otherwise resolve Object ID from Client ID
54+ if [ -n "${{ vars.PRINCIPAL_ID }}" ]; then
55+ echo "Using explicitly configured PRINCIPAL_ID"
56+ echo "AZURE_PRINCIPAL_ID=${{ vars.PRINCIPAL_ID }}" >> $GITHUB_ENV
57+ else
58+ echo "Resolving Service Principal Object ID from Client ID..."
59+ OBJECT_ID=$(az ad sp show --id "$AZURE_CLIENT_ID" --query id -o tsv)
60+ if [ -n "$OBJECT_ID" ]; then
61+ echo "Resolved Object ID: $OBJECT_ID"
62+ echo "AZURE_PRINCIPAL_ID=$OBJECT_ID" >> $GITHUB_ENV
63+ else
64+ echo "::error::Could not resolve Service Principal Object ID from Client ID"
65+ exit 1
66+ fi
67+ fi
68+
5169 - name : Create Resource Group if needed
5270 run : |
5371 # Use provided RG name or derive from environment name
7290 env :
7391 AZD_INITIAL_ENVIRONMENT_CONFIG : ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
7492 AZURE_PRINCIPAL_TYPE : ' ServicePrincipal'
93+ fabricCapacityMode : ' none'
7594 fabricWorkspaceMode : ' none'
You can’t perform that action at this time.
0 commit comments