Hi @Immune, welcome to the forum!
Thanks for pointing out the backend
bug in the documentation, I’ve reported it to the Learn team.
On the second issue, the problem looks like you haven’t set up authentication from Terraform Cloud to Azure. When you log in locally using az login
, this only works for local Terraform runs. When using the remote backend, you need to use Terraform Cloud workspace variables to authenticate.
Here’s how to do that:
- First, you’ll need a service principal. The Azure provider docs describe how to create service principal using the
az
CLI tool. - Because you can’t run
az login
on the Terraform Cloud workers, you’ll need to configure Terraform using environment variables. This section of the provider docs give you the variable names. - Finally, to set those environment variables, use the Terraform Cloud workspace variables UI. Make sure to set them in the bottom “Environment Variables” section.
Sorry that this wasn’t made clear in the guides! It’s quite an involved process, but I hope this helps.