Add Windows environment variable instructions for INFLUXDB3_AUTH_TOKEN (#6325)

* Initial plan

* feat: add Windows environment variable instructions for INFLUXDB3_AUTH_TOKEN

Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>

* refactor: update to new code-placeholders syntax

Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>

* Separate env var and CLI option into distinct sections instead of nested tabs

Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>

* Clarify that both auth methods are for CLI commands with parallel headings

Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>

* fix(3ent/core): Set token env var in Windows, clean up structure

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jstirnaman <212227+jstirnaman@users.noreply.github.com>
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
jts-fix-rp-limit-clauses^2
Copilot 2025-12-02 16:39:12 -06:00 committed by GitHub
parent 6b1905c1d5
commit db9a727789
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 24 deletions

View File

@ -15,7 +15,6 @@ related:
source: /shared/influxdb3-get-started/setup.md
---
<!--
The content of this page is at
<!--
// SOURCE content/shared/influxdb3-get-started/setup.md
-->

View File

@ -15,7 +15,6 @@ related:
source: /shared/influxdb3-get-started/setup.md
---
<!--
The content of this page is at
<!--
// SOURCE content/shared/influxdb3-get-started/setup.md
-->

View File

@ -496,12 +496,10 @@ influxdb3 create token --admin
{{% /code-tab-content %}}
{{% code-tab-content %}}
{{% code-placeholders "CONTAINER_NAME" %}}
```bash
```bash { placeholders="CONTAINER_NAME" }
# With Docker — in a new terminal:
docker exec -it CONTAINER_NAME influxdb3 create token --admin
```
{{% /code-placeholders %}}
Replace {{% code-placeholder-key %}}`CONTAINER_NAME`{{% /code-placeholder-key %}} with the name of your running Docker container.
@ -523,48 +521,58 @@ such as {{% show-in "enterprise" %}}creating additional tokens, {{% /show-in %}}
performing administrative tasks{{% show-in "enterprise" %}},{{% /show-in %}}
and writing and querying data.
#### Authorize CLI commands
Use one of the following methods to provide your token and authenticate `influxdb3` CLI commands.
In your command, replace {{% code-placeholder-key %}}`YOUR_AUTH_TOKEN`{{% /code-placeholder-key %}} with your token string (for example, the [operator token](#create-an-operator-token) from the previous step).
##### Set an environment variable (recommended)
{{< tabs-wrapper >}}
{{% tabs %}}
[Environment variable (recommended)](#)
[Command option](#)
[macOS and Linux](#)
[PowerShell](#)
[CMD](#)
{{% /tabs %}}
{{% tab-content %}}
Set the `INFLUXDB3_AUTH_TOKEN` environment variable to have the CLI use your
token automatically:
{{% code-placeholders "YOUR_AUTH_TOKEN" %}}
```bash
```bash { placeholders="YOUR_AUTH_TOKEN" }
export INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN
```
{{% /code-placeholders %}}
{{% /tab-content %}}
{{% tab-content %}}
Include the `--token` option with CLI commands:
{{% code-placeholders "YOUR_AUTH_TOKEN" %}}
```bash
influxdb3 show databases --token YOUR_AUTH_TOKEN
```powershell { placeholders="YOUR_AUTH_TOKEN" }
$env:INFLUXDB3_AUTH_TOKEN = "YOUR_AUTH_TOKEN"
```
{{% /tab-content %}}
{{% tab-content %}}
```cmd { placeholders="YOUR_AUTH_TOKEN" }
set INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN
# Make sure to include a space character at the end of this command.
```
{{% /code-placeholders %}}
{{% /tab-content %}}
{{< /tabs-wrapper >}}
##### Use the `--token` option
```bash { placeholders="YOUR_AUTH_TOKEN" }
influxdb3 show databases --token YOUR_AUTH_TOKEN
```
#### Authorize HTTP API requests
For HTTP API requests, include your token in the `Authorization` header--for example:
{{% code-placeholders "YOUR_AUTH_TOKEN" %}}
```bash
```bash { placeholders="YOUR_AUTH_TOKEN" }
curl "http://{{< influxdb/host >}}/api/v3/configure/database" \
--header "Authorization: Bearer YOUR_AUTH_TOKEN"
```
{{% /code-placeholders %}}
#### Learn more about tokens and permissions