Azure / login

Connect to Azure
MIT License
294 stars 283 forks source link

Can't login with SP #475

Open JasonFreeberg opened 1 month ago

JasonFreeberg commented 1 month ago

I ran this:

az ad sp create-for-rbac --name "myApp" --role contributor --scopes /subscriptions/redacted --json-auth

Which output this:

{
  "clientId": "redacted",
  "clientSecret": "redacted",
  "subscriptionId": "redacted,
  "tenantId": "redacted5",
  "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
  "resourceManagerEndpointUrl": "https://management.azure.com/",
  "activeDirectoryGraphResourceId": "https://graph.windows.net/",
  "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
  "galleryEndpointUrl": "https://gallery.azure.com/",
  "managementEndpointUrl": "https://management.core.windows.net/"
}

I pasted that into a GitHub secret, and added it to the action:

    - name: Azure Login
      uses: Azure/login@v2
      with:
        creds: ${{ secrets.AZURE_CREDENTIALS }}

And I get this error:

Attempting Azure CLI login by using service principal with secret...
Error: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '***'. Trace ID: f6759202-f04f-49b2-809a-d42aef193600 Correlation ID: 0091834a-0f41-42d5-b227

This used to work, what gives?

MoChilia commented 1 month ago

Could you check if the secret is properly created and still valid? You can verify this on the portal. image