Skip to content

Commit ff47a00

Browse files
feat: Add Power BI API access check before infrastructure provisioning
1 parent aaf5167 commit ff47a00

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

.github/workflows/azure-dev.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,23 @@ jobs:
8686
echo "⚠️ Admin consent required. Grant manually in Azure Portal if Fabric setup fails."
8787
8888
echo "Power BI API permissions configured"
89-
- name: Provision Infrastructure
90-
id: provision
89+
- name: Check Power BI API Access
90+
id: check-powerbi
9191
continue-on-error: true
92+
run: |
93+
echo "Testing Power BI API access..."
94+
TOKEN=$(az account get-access-token --resource https://analysis.windows.net/powerbi/api --query accessToken -o tsv 2>/dev/null)
95+
if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then
96+
echo "powerbi_access=true" >> $GITHUB_OUTPUT
97+
echo "✓ Power BI API access confirmed"
98+
else
99+
echo "powerbi_access=false" >> $GITHUB_OUTPUT
100+
echo "⚠️ Power BI API access not available. Fabric workspace automation will be skipped."
101+
echo " To enable: Grant Power BI API permissions and admin consent to the service principal."
102+
fi
103+
- name: Provision Infrastructure
92104
run: azd provision --no-prompt
93105
env:
94106
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
95107
principalType: 'ServicePrincipal'
96-
- name: Re-authenticate for Retry
97-
if: steps.provision.outcome == 'failure'
98-
uses: azure/login@v2
99-
with:
100-
client-id: ${{ vars.AZURE_CLIENT_ID }}
101-
tenant-id: ${{ vars.AZURE_TENANT_ID }}
102-
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
103-
- name: Retry Failed Hooks with Fresh Token
104-
if: steps.provision.outcome == 'failure'
105-
run: |
106-
echo "Retrying with fresh authentication token..."
107-
azd provision --no-prompt
108-
env:
109-
principalType: 'ServicePrincipal'
108+
fabricWorkspaceMode: ${{ steps.check-powerbi.outputs.powerbi_access == 'true' && 'create' || 'skip' }}

0 commit comments

Comments
 (0)