Skip to content

Action does not seem to support Azure login when using terraform.outputs functions #65

Description

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Currently, the action has an option to process-templates: 'true' which enables template rendering and also supports using terraform.outputs functions but when using Azure it seems that the action does not respect the AZURE_ Env variables that can be passed down to the terraform provider.

Expected Behavior

Steps to Reproduce

Add a workflow step as follow :

 - name: Get atmos settings
       id: atmos-settings
        uses: cloudposse/github-action-atmos-get-setting@v2
        env:
          ARM_CLIENT_ID: "xxxxxxxxxx0"
          ARM_SUBSCRIPTION_ID: "xxxxxxxx"
          ARM_TENANT_ID: "xxxxxxx"
          AZURE_USE_OIDC: true
          ATMOS_LOGS_FILE: "/dev/null"
          ATMOS_LOGS_LEVEL: "Trace"
        with:
         # Here, we do not process templates because that requires terraform. Which we install after fetching the version
          # Processing templates here can cause an issue where cached terraform versions conflict with the version we want to install
           process-templates: "false"
           settings: |
             - component: keyvault
               stack: dev-wus3
               settingsPath: settings.integrations.github.gitops.terraform-version
               outputPath: terraform-version

The error shown:

  │ exit status 1
  │ 
  │ Error: Error building ARM Config: Authenticating using the Azure CLI is only supported as a User (not a Service Principal).
  │ 
  │ To authenticate to Azure using a Service Principal, you can use the separate 'Authenticate using a Service Principal'
  │ auth method - instructions for which can be found here: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret
  │ 
  │ Alternatively you can authenticate using the Azure CLI by using a User Account.
  │ 
✗ Fetching api_management_identity output from apimanagement/be in dev-wus3
Error: Process completed with exit code 1.

Anything that will help us triage the bug will help. Here are some ideas:

  • Github actions

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions