Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Failed to authenticate with azure #8

Open
dalmasj opened this issue Sep 3, 2021 · 8 comments
Open

Failed to authenticate with azure #8

dalmasj opened this issue Sep 3, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@dalmasj
Copy link

dalmasj commented Sep 3, 2021

Hello,

We have an issue when using v3.3 with the following error :
level=error msg="Failed to authenticate with azure: Invoking Azure CLI failed with the following error: "

Before this action we login to azure with Azure/login and the login was successfull
The secret for login is like { "clientId": "***", "clientSecret": "***", "subscriptionId": "***", "tenantId": "***"}

Do you have any idea what is wrong ?
Thank you

@dalmasj dalmasj added the bug Something isn't working label Sep 3, 2021
@nmeisenzahl
Copy link
Member

@StiviiK can you please review this issue.

@nmeisenzahl nmeisenzahl assigned StiviiK and unassigned nmeisenzahl Sep 3, 2021
@StiviiK
Copy link
Contributor

StiviiK commented Sep 3, 2021

Hi @dalmasj, may you please provide your workflow file? So I can look into this issue further.

@dalmasj
Copy link
Author

dalmasj commented Sep 3, 2021

Hi,
My workflow file is like that:

  on: 
    push:
      branches: [ workflowconfiguration ]
  env:
    templatePath: ARMTemplateForFactory.json
    resourceGroupName: xxxx
    factoryName: xxxxx
    xxxx_connectionString: xxx
  
  jobs:
    build-and-deploy:
      runs-on: ubuntu-18.04
      steps:
      - name: Checkout GitHub Action
        uses: actions/checkout@main
        
      - name: Login via Az Module
        uses: azure/login@v1
        with:
          creds: ${{secrets.AZURE_CREDS}}
          enable-AzPSSession: true
            
      - name: Deploy arm template adf
        uses: whiteducksoftware/azure-arm-action@v3.3
        with:
          resourceGroupName: ${{env.resourceGroupName }}
          templateLocation: ${{env.templatePath }}
          deploymentName: "datafactorydeployment"
          overrideparameters:
                            factoryName=${{env.factoryName}}
                            xxxx_connectionString=${{env.xxxx_connectionString}}

@StiviiK
Copy link
Contributor

StiviiK commented Sep 3, 2021

Try setting enable-AzPSSession to false. As the Action utilises the CLI and not the Powershell module.

@dalmasj
Copy link
Author

dalmasj commented Sep 3, 2021

Ok i tried and we still have the same error : level=error msg="Failed to authenticate with azure: Invoking Azure CLI failed with the following error: "

@StiviiK
Copy link
Contributor

StiviiK commented Sep 3, 2021

Okay, at first glance I don't see any obvious error. Sadly the upstream library we are using has an issue so it doesn't return the error correctly (as it is in your case empty). I have implemented a temporary fix myself (c836b23).
On Monday I will provide you instructions on how to test with these changes.

@StiviiK
Copy link
Contributor

StiviiK commented Sep 6, 2021

Hi @dalmasj, I have some updates for you.

The issue came up due to GitHub changing how the virtual runtime of their hosted runners works, as so I had to revert back the authentication to be handled by the Action itself (as so @azure/login is no longer supported.). I have already published a fix and retagged it with the Version v3.3 (#9).

All you need to do to get it working again is to remove Login via Az Module and move the creds parameter to Deploy arm template adf and it should be working again.

@StiviiK
Copy link
Contributor

StiviiK commented Sep 7, 2021

@dalmasj does your issue still occur or has it been fixed by my latest changes?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants