Skip to content

Commit

Permalink
Step to get secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Johnston committed Oct 7, 2023
1 parent ba4bea8 commit 8157312
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/main_joeljca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: |
ls
ls ./cicd
.\cicd\PS-Connect-AZ-Account.ps1
1 change: 1 addition & 0 deletions cicd/PS-Connect-Az-Account.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8157312

Please sign in to comment.