GitHub Workflow Failing at Azure Login

AJ 20 Reputation points


I'm following this MS Learn Exercise and running into a login issue.

Error: Login failed with Error: Using auth-type: SERVICE_PRINCIPAL. Not all values are present. Ensure 'client-id' and 'tenant-id' are supplied.. Double check if the 'auth-type' is correct. Refer to for more information.

I'm unsure why I'm running into this issue. I confirmed the client-id and tenant-id are stored in Github Secrets. Any help or guidance would greatly be appreciated.

Here is the workflow file.

name: Deploy ARM Template
      - main
  AZURE_SUBSCRIPTION_ID: '[REDACTED]'  # set this to your Azure Subscription Id
  AZURE_RESOURCE_GROUP: GitHubActionExercise-rg   # set this to your target resource group
    runs-on: ubuntu-latest
      - name: Checkout source code
        uses: actions/checkout@main
      - name: Login to Azure
        uses: azure/login@v1
          creds: ${{ secrets.AZURE_CREDENTIALS }}
      - name: Deploy ARM Template
        uses: azure/arm-deploy@v1
          scope: resourcegroup
          subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
          resourceGroupName: ${{ env.AZURE_RESOURCE_GROUP }}
          template: ./azuredeploy.json

GitHub Secrets AZURE_CREDENTIALS Contents

  "clientId": "[REDACTED]",
  "clientSecret": "[REDACTED]",
  "subscriptionId": "[REDACTED]",
  "tenantId": "[REDACTED]",
  "activeDirectoryEndpointUrl": "",
  "resourceManagerEndpointUrl": "",
  "activeDirectoryGraphResourceId": "",
  "sqlManagementEndpointUrl": "",
  "galleryEndpointUrl": "",
  "managementEndpointUrl": ""

This question is related to the following Learning Module

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,147 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AJ 20 Reputation points

    I was able to resolve the issue.

    The MS Learn instructions stated to save the secrets as Codespaces.

    codespacesHowever, after further reading and testing, I found that the Secrets should have been saved under Actions.

    actions Once I made this update and re-ran the GitHub workflow, I successfully deployed the Azure resource via template. I hope this helps anyone who is learning or encountering this issue.

    Hopefully, Microsoft Learn sees this ticket and updates their documentation.

    0 comments No comments

  2. Rakesh Gurram 4,560 Reputation points Microsoft Vendor

    Hi AJ,

    Thank you for your patience.

    We have successfully replicated the steps within the module. Please ensure that your assigned role is 'Contributor.' If it is not, assign yourself the 'Contributor' role and avoid using restricted Azure directories. Additionally, verify that the client secrets in both the CLI and GitHub secrets are correct and save them under Action secrets.

    User's image


    This has been created resource within the given resource group. Resource Group>>Settings>>Deployments>>Created Resource (VNet) as shown:

    User's image

    Please don't hesitate to reach out to us if you have any other queries with screenshots of the error (after concealing your PII).

    If the information is helpful, please Accept Answer & Upvote so that it would be helpful to other community members.

    Thank you.