Need help with HCP Terraform setup using Azure
I’m stuck trying to set up HCP Terraform. The guide asks for AWS credentials, but I only have an Azure account. Does anyone know how to get the equivalent of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for Azure?
I’ve looked everywhere in my Azure portal but can’t find anything similar. It’s frustrating because I can’t move forward without these credentials.
Has anyone successfully set up HCP Terraform with Azure instead of AWS? Any tips or workarounds would be super helpful. I’m new to cloud stuff, so please explain like I’m five!
Thanks in advance for any help. I really want to get this working!
I’ve been through this exact situation, and I can tell you it’s a bit tricky at first. For Azure, you’ll need to create a Service Principal, which is essentially Azure’s equivalent to AWS access keys. To accomplish this, you can open your Azure Cloud Shell and run the command ‘az ad sp create-for-rbac --name “MyTerraformSP” --role Contributor’. This command returns a JSON output containing an ‘appId’, which serves as the client ID, and a ‘password’, which is the client secret. You then use these values in place of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for your HCP Terraform setup. Additionally, ensure that your Azure subscription ID and tenant ID are set as environment variables. It took some time to figure it out, but this method ultimately works well.
hey claire29, i feel ya. azure can be a pain. for hcp terraform, u need azure service principal. go to azure portal, hit azure active directory, then app registrations. make a new one, grab the app ID and create a secret. use those instead of aws keys. it’s not super straightforward but works. good luck!