Skip to content

Commit

Permalink
update credential handling
Browse files Browse the repository at this point in the history
  • Loading branch information
samtkaplan committed Dec 5, 2022
1 parent f715315 commit 5adc430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/[email protected]
- uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
creds: '{"clientId":"${{ secrets.CLIENT_ID }}","clientSecret":"${{ secrets.CLIENT_SECRET }}","subscriptionId":"${{ secrets.SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TENANT_ID }}"}'
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
Expand All @@ -26,7 +26,9 @@ jobs:
- uses: julia-actions/julia-buildpkg@latest #change lastest to master
- uses: julia-actions/julia-runtest@latest #change lastest to master
env:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
TENANT: ${{ secrets.TENANT_ID }}
STORAGE_ACCOUNT: "s${{ steps.uuid.outputs.uuid }}"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
Expand Down
8 changes: 5 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ function robust_open(c, s...)
end
end

credentials = JSON.parse(ENV["AZURE_CREDENTIALS"])
AzSessions.write_manifest(;client_id=credentials["clientId"], client_secret=credentials["clientSecret"], tenant=credentials["tenantId"])
client_id = ENV["CLIENT_ID"]
client_secret = ENV["CLIENT_SECRET"]
tenant = ENV["TENANT"]
AzSessions.write_manifest(;client_id, client_secret, tenant)

session = AzSession(;protocal=AzClientCredentials, client_id=credentials["clientId"], client_secret=credentials["clientSecret"], resource="https://storage.azure.com/")
session = AzSession(;protocal=AzClientCredentials, client_id, client_secret, resource="https://storage.azure.com/")

storageaccount = ENV["STORAGE_ACCOUNT"]
@info "storageaccount=$storageaccount"
Expand Down

0 comments on commit 5adc430

Please sign in to comment.