From b438c4ae1ca9111162981d710f15db6de4a3ea78 Mon Sep 17 00:00:00 2001 From: Pradeep Srikakolapu Date: Fri, 22 Nov 2024 17:41:38 -0800 Subject: [PATCH] Testing OIDC --- .github/workflows/integration-tests-azure.yml | 54 +++---------------- 1 file changed, 8 insertions(+), 46 deletions(-) diff --git a/.github/workflows/integration-tests-azure.yml b/.github/workflows/integration-tests-azure.yml index 1198d19..4106ec4 100644 --- a/.github/workflows/integration-tests-azure.yml +++ b/.github/workflows/integration-tests-azure.yml @@ -11,7 +11,7 @@ permissions: contents: read jobs: - integration-tests-azure: + integration-tests-fabric-dw: name: Regular strategy: fail-fast: false @@ -24,48 +24,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3.3.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: List containers in GitHub Container Registry - run: docker images - - - name: List containers with GitHub API - run: | - curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/orgs/microsoft/packages?package_type=container - - - name: Pull Docker image - run: docker pull ghcr.io/microsoft/dbt-fabric:CI-3.11-msodbc17 - - # 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 "::add-mask::$TOKEN" # Mask the token in the logs - echo "ACCESS_TOKEN=$TOKEN" >> $GITHUB_ENV - echo "Token fetched successfully" - - # Print the token (for debugging) - - name: Print Access Token - run: | - echo "Access Token: ${{ env.ACCESS_TOKEN }}" + - name: Azure Login + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + federated-token: ${{ secrets.GITHUB_TOKEN }} + allow-no-subscriptions: true