Skip to content

Commit a1ffc0f

Browse files
authored
Merge pull request #223052 from eric-urban/eur/env-vars
align closer to language service approach
2 parents 3fa8e8b + 476ed3c commit a1ffc0f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

articles/cognitive-services/Speech-Service/includes/common/environment-variables.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,43 @@ Your application must be authenticated to access Cognitive Services resources. F
1212
> [!TIP]
1313
> Don't include the key directly in your code, and never post it publicly. See the Cognitive Services [security](../../../security-features.md) article for more authentication options like [Azure Key Vault](../../../use-key-vault.md).
1414
15-
To set the environment variable for your Speech resource key, open a console window, and follow the instructions for your operating system and development environment. To set the `SPEECH_KEY` environment variable, replace `your-key` with one of the keys for your resource.
15+
To set the environment variable for your Speech resource key, open a console window, and follow the instructions for your operating system and development environment.
16+
- To set the `SPEECH_KEY` environment variable, replace `your-key` with one of the keys for your resource.
17+
- To set the `SPEECH_REGION` environment variable, replace `your-region` with one of the keys for your resource.
1618

1719
#### [Windows](#tab/windows)
1820

1921
```console
2022
setx SPEECH_KEY your-key
23+
setx SPEECH_REGION your-region
2124
```
2225

2326
> [!NOTE]
2427
> If you only need to access the environment variable in the current running console, you can set the environment variable with `set` instead of `setx`.
2528
26-
After you add the environment variable, you may need to restart any running programs that will need to read the environment variable, including the console window. For example, if you are using Visual Studio as your editor, restart Visual Studio before running the example.
29+
After you add the environment variables, you may need to restart any running programs that will need to read the environment variable, including the console window. For example, if you are using Visual Studio as your editor, restart Visual Studio before running the example.
2730

2831
#### [Linux](#tab/linux)
2932

3033
```bash
3134
export SPEECH_KEY=your-key
35+
export SPEECH_REGION=your-region
3236
```
3337

34-
After you add the environment variable, run `source ~/.bashrc` from your console window to make the changes effective.
38+
After you add the environment variables, run `source ~/.bashrc` from your console window to make the changes effective.
3539

3640
#### [macOS](#tab/macos)
3741

3842
##### Bash
3943

40-
Edit your .bash_profile, and add the environment variable:
44+
Edit your .bash_profile, and add the environment variables:
4145

4246
```bash
4347
export SPEECH_KEY=your-key
48+
export SPEECH_REGION=your-region
4449
```
4550

46-
After you add the environment variable, run `source ~/.bash_profile` from your console window to make the changes effective.
51+
After you add the environment variables, run `source ~/.bash_profile` from your console window to make the changes effective.
4752

4853
##### Xcode
4954

@@ -54,7 +59,7 @@ For iOS and macOS development, you set the environment variables in Xcode. For e
5459
1. Under **Environment Variables** select the plus (+) sign to add a new environment variable.
5560
1. Enter `SPEECH_KEY` for the **Name** and enter your Speech resource key for the **Value**.
5661

62+
To set the environment variable for your Speech resource region, follow the same steps. Set `SPEECH_REGION` to the region of your resource. For example, `westus`.
63+
5764
For more configuration options, see the [Xcode documentation](https://help.apple.com/xcode/#/dev745c5c974).
5865
***
59-
60-
To set the environment variable for your Speech resource region, follow the same steps. Set `SPEECH_REGION` to the region of your resource. For example, `westus`.

0 commit comments

Comments
 (0)