Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment Failed, Error: No credentials found #445

Open
rufer7 opened this issue Nov 5, 2024 · 4 comments
Open

Deployment Failed, Error: No credentials found #445

rufer7 opened this issue Nov 5, 2024 · 4 comments

Comments

@rufer7
Copy link

rufer7 commented Nov 5, 2024

For some not yet identified reason, the azure/webapps-deploy@v3 (I also tried azure/[email protected]) fails with the following error:

Error: Deployment Failed, Error: No credentials found. Add an Azure login action before this action. For more details refer https://github.com/azure/login

My GitHub actions workflow job looks as follows:

  deploy:
    name: Deploy to Azure Web App
    runs-on: ubuntu-latest
    environment: dev
    needs: [build_test_publish, iac_apply]
    steps:
      - name: Download artifact
        uses: actions/download-artifact@v4
      - uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
      - name: Deploy to Azure Web App
        uses: azure/[email protected]
        with:
          app-name: my-app
          package: .
      - name: Logout
        run: |
          az logout

The steps Download artifact and azure/login@v2 both succeed. To set up the secrets, I followed the official docs here and the jobs before the one above succeed with the same secrets (iac_apply for example). I also enabled debug logging where I saw that az account show is executed and the next log entry was {} so I assume the account show command returns an empty object. But I have no idea why. Would be happy about any suggestions, hints or resolutions.

@borislavml
Copy link

We have the exact same setup and have the exact same problem. The az login work for Azure/functions-action but NOT for azure/webapps-deploy with a private endpoint. The workaround is to use azure/[email protected] . Why this has been neglected for so long, the action is already on 3.0.2. Who's even using the versions above 2.2.9 if they are not working?

@rufer7
Copy link
Author

rufer7 commented Nov 8, 2024

@borislavml unfortunately v2.2.9 didn't work either (same error msg). As a workaround I used az cli: https://github.com/rufer7/dotnet-webapi-using-az-key-vault-secret-rotated-by-terraform/blob/main/.github/workflows/ci-cd.yml

@prathambande
Copy link

Hello @rufer7 . Are you by any chance using AZURE_CORE_OUTPUT: none in env of the workflow? If yes, then that is causing the issue. Do let us know.

@rufer7
Copy link
Author

rufer7 commented Dec 23, 2024

Hello @prathambande thanks for the hint. Yes, I do. I wasn't aware of this could cause the issue, but could make sense. I'll check in the next days. If this helps I can create a PR to extend the README with a troubleshooting section. Would that be appreciated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants