Does anyone by chance have an example of using env...
# azure
p
Does anyone by chance have an example of using environment secrets to log into an AZ blob backend? Im stuck and not sure what Im doing wrong. Here is my workflow file. Its very simple as Im beta testing actions.
b
@purple-train-14007 we use
go-cloud
for our blob support, so you need to configure the environment variables as defined here: https://gocloud.dev/howto/blob/#azure
Copy code
AZURE_STORAGE_ACCOUNT
and then either
AZURE_STORAGE_KEY
or
AZURE_STORAGE_SAS_TOKEN
p
Yeah Im doing that but Im trying to pull the actual text out of GH Actions Environment Secrets see here
Copy code
steps:
      - uses: actions/checkout@v2

      - name: Integration Testing
        env:
          STORAGE_ACCOUNT: ${{secrets.SEA_STORAGE_ACCNT}}
          STORAGE_TOKEN: ${{secrets.SEA_STORAGE_ACCN_PWD}}
        run: |
          $env:AZURE_STORAGE_ACCOUNT = $env.STORAGE_ACCOUNT
          $env:AZURE_STORAGE_SAS_TOKEN = $env.STORAGE_TOKEN
          pulumi login --cloud-url <azblob://pulumi>
        shell: PowerShell
I was able to figure it out 🙂
b
@purple-train-14007 mind sharing the answer?
p
Yeah, so typically in powershell you dont quote "" your variables however in order to use the GitHub Actions environment variables you have to double quote them.
Copy code
steps:
      - uses: actions/checkout@v2

      - name: Integration Testing
        run: |
          $env:AZURE_STORAGE_ACCOUNT = "${{ secrets.SEA_STORAGE_ACCNT }}"
          $env:AZURE_STORAGE_SAS_TOKEN = "${{ secrets.SEA_STORAGE_ACCN_PWD }}"
          pulumi login --cloud-url <azblob://pulumi>
          Set-Location -Path .\src\Azure_AD_Network
          pulumi stack ls
        shell: PowerShell
otherwise powershell will try to read that as a command for some reason