diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index f940a0c51..a4a08c40b 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -20,16 +20,21 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: 'Log in to Azure' - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Log in to Azure + run: | + az login --service-principal -u ${{ secrets.ARM_CLIENT_ID }} -p ${{ secrets.ARM_CLIENT_SECRET }} --tenant ${{ secrets.ARM_TENANT_ID }} + az account set --subscription ${{ secrets.ARM_SUBSCRIPTION_ID }} - name: Setup Terraform uses: hashicorp/setup-terraform@v1 - name: Initialize Terraform working-directory: components + env: + ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} + ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} + ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} + ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} run: | terraform init \ -backend-config="resource_group_name=rule-set-rg" \ @@ -40,10 +45,10 @@ jobs: - name: Plan and Apply Terraform working-directory: components env: - ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - ARM_SUBSCRIPTION_ID: ${{ secrets.DCD_CFT_SANDBOX_SUBSCRIPTION }} - ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} + ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} + ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} + ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} run: | terraform plan -out=tfplan -var-file="terraform.tfvars"