Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.44 KB

environment-variables.md

File metadata and controls

47 lines (32 loc) · 1.44 KB
author ms.service ms.topic ms.date ms.author
PatrickFarley
azure-ai-vision
include
08/07/2023
pafarley

Create environment variables

In this example, write your credentials to environment variables on the local machine that runs the application.

[!INCLUDE find key and endpoint]

Tip

Don't include the key directly in your code, and never post it publicly. See the Azure AI services security article for more authentication options like Azure Key Vault.

To set the environment variable for your key and endpoint, open a console window and follow the instructions for your operating system and development environment.

  1. To set the VISION_KEY environment variable, replace your-key with one of the keys for your resource.
  2. To set the VISION_ENDPOINT environment variable, replace your-endpoint with the endpoint for your resource.
setx VISION_KEY <your_key>
setx VISION_ENDPOINT <your_endpoint>

After you add the environment variables, you may need to restart any running programs that will read the environment variables, including the console window.

export VISION_KEY=<your_key>
export VISION_ENDPOINT=<your_endpoint>

After you add the environment variables, run source ~/.bashrc from your console window to make the changes effective.