From 15f3c7df6ff3cd4a9badd1209e77ba99ec73519f Mon Sep 17 00:00:00 2001 From: Pradeep Srikakolapu Date: Fri, 22 Nov 2024 18:42:00 -0800 Subject: [PATCH] Testing OIDC --- .github/workflows/integration-tests-azure.yml | 49 +++++++++++++++---- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration-tests-azure.yml b/.github/workflows/integration-tests-azure.yml index c5784c6..b2ba749 100644 --- a/.github/workflows/integration-tests-azure.yml +++ b/.github/workflows/integration-tests-azure.yml @@ -32,16 +32,45 @@ jobs: 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 + - name: Install ODBC Driver 18 for SQL Server (Ubuntu) run: | - TOKEN=$(az account get-access-token --resource "https://database.windows.net/" --query accessToken -o tsv) - echo "ACCESS_TOKEN=$TOKEN" >> $GITHUB_ENV - # Output the token (slightly modified to bypass masking) - echo "Access Token: ${TOKEN::-4}****" + sudo apt-get update + sudo apt-get install -y gnupg + curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - + curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list + sudo apt-get update + sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 - # Print the token (for debugging) - - name: Print Access Token + - name: Install Python dependencies run: | - echo "Access Token: ${{ env.ACCESS_TOKEN }}" + python3 -m venv venv + source venv/bin/activate + pip install azure-identity pyodbc + + - name: Connect to Azure SQL Database + run: | + python - <