Testing OIDC #269
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Integration tests on Fabric DW | |
on: # yamllint disable-line rule:truthy | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- oidc_connect | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
integration-tests-fabric-dw: | |
name: Regular | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
profile: ["ci_azure_auto"] | |
python_version: ["3.11"] | |
msodbc_version: ["17", "18"] | |
runs-on: ubuntu-latest | |
steps: | |
# Azure login using federated credentials | |
- name: Azure login with OIDC | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.DBT_AZURE_SP_NAME }} | |
tenant-id: ${{ secrets.DBT_AZURE_TENANT }} | |
allow-no-subscriptions: true | |
federated-token: true | |
# Get an access token for a specific resource (e.g., a database) | |
- name: Get Azure Access Token | |
id: get-token | |
run: | | |
TOKEN=$(az account get-access-token --resource "https://database.windows.net//.default" --query accessToken -o tsv) | |
echo "ACCESS_TOKEN=$TOKEN" >> $GITHUB_ENV | |
# Output the token (slightly modified to bypass masking) | |
echo "Access Token: ${TOKEN::-4}****" | |
# Print the token (for debugging) | |
- name: Print Access Token | |
run: | | |
echo "Access Token: ${{ env.ACCESS_TOKEN }}" |