You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/includes/common/environment-variables.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,38 +12,43 @@ Your application must be authenticated to access Cognitive Services resources. F
12
12
> [!TIP]
13
13
> 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).
14
14
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.
16
18
17
19
#### [Windows](#tab/windows)
18
20
19
21
```console
20
22
setx SPEECH_KEY your-key
23
+
setx SPEECH_REGION your-region
21
24
```
22
25
23
26
> [!NOTE]
24
27
> 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`.
25
28
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.
27
30
28
31
#### [Linux](#tab/linux)
29
32
30
33
```bash
31
34
export SPEECH_KEY=your-key
35
+
export SPEECH_REGION=your-region
32
36
```
33
37
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.
35
39
36
40
#### [macOS](#tab/macos)
37
41
38
42
##### Bash
39
43
40
-
Edit your .bash_profile, and add the environment variable:
44
+
Edit your .bash_profile, and add the environment variables:
41
45
42
46
```bash
43
47
export SPEECH_KEY=your-key
48
+
export SPEECH_REGION=your-region
44
49
```
45
50
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.
47
52
48
53
##### Xcode
49
54
@@ -54,7 +59,7 @@ For iOS and macOS development, you set the environment variables in Xcode. For e
54
59
1. Under **Environment Variables** select the plus (+) sign to add a new environment variable.
55
60
1. Enter `SPEECH_KEY` for the **Name** and enter your Speech resource key for the **Value**.
56
61
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
+
57
64
For more configuration options, see the [Xcode documentation](https://help.apple.com/xcode/#/dev745c5c974).
58
65
***
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