|
| 1 | +--- |
| 2 | +title: "Environment variables" |
| 3 | +description: set environment variables |
| 4 | +services: cognitive-services |
| 5 | +author: PatrickFarley |
| 6 | +manager: nitinme |
| 7 | +ms.service: cognitive-services |
| 8 | +ms.subservice: forms-recognizer |
| 9 | +ms.topic: include |
| 10 | +ms.date: 05/06/2020 |
| 11 | +ms.author: pafarley |
| 12 | +--- |
| 13 | + |
| 14 | +Using your key and endpoint from the resource you created, create two environment variables for authentication: |
| 15 | + |
| 16 | +* `FORM_RECOGNIZER_KEY` - The resource key for authenticating your requests. |
| 17 | +* `FORM_RECOGNIZER_ENDPOINT` - The resource endpoint for sending API requests. It will look like this: |
| 18 | + * `https://<your-custom-subdomain>.api.cognitive.microsoft.com` |
| 19 | + |
| 20 | +>[!NOTE] |
| 21 | +> The endpoints for non-trial resources created after July 1, 2019 use the custom subdomain format shown below. For more information and a complete list of regional endpoints, see [Custom subdomain names for Cognitive Services](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains). |
| 22 | +
|
| 23 | +Use the following instructions to set environment variables on your operating system. |
| 24 | + |
| 25 | +#### [Windows](#tab/windows) |
| 26 | + |
| 27 | +```console |
| 28 | +setx FORM_RECOGNIZER_KEY <replace-with-your-form-recognizer-key> |
| 29 | +setx FORM_RECOGNIZER_ENDPOINT <replace-with-your-form-recognizer-endpoint> |
| 30 | +``` |
| 31 | + |
| 32 | +After you add the environment variables, close and reopen the console window. |
| 33 | + |
| 34 | +#### [Linux](#tab/linux) |
| 35 | + |
| 36 | +```bash |
| 37 | +export FORM_RECOGNIZER_KEY=<replace-with-your-product-name-key> |
| 38 | +export FORM_RECOGNIZER_ENDPOINT=<replace-with-your-product-name-endpoint> |
| 39 | +``` |
| 40 | + |
| 41 | +After you add the environment variable, run `source ~/.bashrc` from your console window to make the changes effective. |
| 42 | + |
| 43 | +#### [macOS](#tab/unix) |
| 44 | + |
| 45 | +Edit your `.bash_profile`, and add the environment variable: |
| 46 | + |
| 47 | +```bash |
| 48 | +export FORM_RECOGNIZER_KEY=<replace-with-your-product-name-key> |
| 49 | +export FORM_RECOGNIZER_ENDPOINT=<replace-with-your-product-name-endpoint> |
| 50 | +``` |
| 51 | + |
| 52 | +After you add the environment variables, run `source .bash_profile` from your console window to make the changes effective. |
| 53 | +*** |
0 commit comments