diff --git a/.github/workflows/main_joeljca.yml b/.github/workflows/main_joeljca.yml index d8337e3..c62580d 100644 --- a/.github/workflows/main_joeljca.yml +++ b/.github/workflows/main_joeljca.yml @@ -10,9 +10,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Echo back environment + - name: Write environment to global variables + shell: bash + run: | + echo JJ_AZ_APP_ID=${{ vars.JJ_AZ_APP_ID }} >> "$GITHUB_ENV" + echo JJ_AZ_SECRET=${{ secrets.JJ_AZ_SECRET }} >> "$GITHUB_ENV" + echo JJ_AZ_TENANT_ID=${{ vars.JJ_AZ_TENANT_ID }} >> "$GITHUB_ENV" + - name: (Sanity) echo back environment shell: pwsh run: Write-Host $($Env:JJ_AZ_SECRET.length -gt 0) $Env:JJ_AZ_APP_ID $Env:JJ_AZ_TENANT_ID - name: Connect Azure account shell: pwsh - run: ./cicd/PS-Connect-AZ-Account.ps1 \ No newline at end of file + run: | + ls + ls ./cicd + .\cicd\PS-Connect-AZ-Account.ps1 \ No newline at end of file diff --git a/cicd/PS-Connect-Az-Account.ps1 b/cicd/PS-Connect-Az-Account.ps1 index 5e7895b..8af7eb4 100644 --- a/cicd/PS-Connect-Az-Account.ps1 +++ b/cicd/PS-Connect-Az-Account.ps1 @@ -1,3 +1,4 @@ +Write-Host 'IN PS-Connect-AZ-Account.ps1' $SecureStringPwd = $Env:JJ_AZ_SECRET | ConvertTo-SecureString -AsPlainText -Force $AzPsCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Env:JJ_AZ_APP_ID, $SecureStringPwd Connect-AzAccount -ServicePrincipal -Credential $AzPsCredential -Tenant $Env:JJ_AZ_TENANT_ID \ No newline at end of file