Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokens invalid when az and terraform run on different timezones #1706

Merged
merged 2 commits into from
Aug 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions website/docs/authenticating_via_azure_cli.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ We recommend [using a Service Principal when running in a shared environment](au

~> **NOTE:** Authenticating via the Azure CLI is only supported when using a User Account. If you're using a Service Principal (e.g. via `az login --service-principal`) you should instead [authenticate via the Service Principal directly](authenticating_via_service_principal.html).

~> **NOTE:** Take note that when `az login` fetches access_tokens, these are interpreted (and stored) according to the timezone settings the azure-cli runs in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

access_tokens -> the access tokens


When the timezones `az` and `terraform` run in differ (because `az` is run inside docker, which defaults to UTC, and `terraform` on some host, not UTC), `terraform` interprets the token differently from what `az` intended and may incorrectly determines the token to be stale and invalid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"because az" -> "for example when az`

"and terraform on some host, not UTC" -> "the system timezone where Terraform runs isn't UTC"


When `terraform` and `az` are run on hosts / containers with different timezones, the variable $TZ should be set on the host.

When authenticating via the Azure CLI, Terraform will automatically connect to the Default Subscription - this can be changed by using the Azure CLI - and is documented below.

## Configuring the Azure CLI
Expand Down