Skip to content
Open
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,4 @@ cython_debug/
# VSCode
.vscode
.azure
test_output/
12 changes: 6 additions & 6 deletions docs/set_env_for_training_data_and_reference_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ The folders [document_training](../data/document_training/) and [field_extractio
- Note: **Write** permission is required for uploading, modifying, or appending blobs.
- Click the **Create** button.
<img src="./get-access-signature.png" height="600" /> <img src="./choose-signature-options.png" height="600" />
- **Copy the SAS URL:** After creating the SAS, click **Copy** to get the URL with the token. This URL will be used as the value for either **TRAINING_DATA_SAS_URL** or **REFERENCE_DOC_SAS_URL** when running the sample code.
- **Copy the SAS URL:** After creating the SAS, click **Copy** to get the URL with the token. This URL will be used as the value for either **training_data_sas_url** or **REFERENCE_DOC_SAS_URL** when running the sample code.
<img src="./copy-access-signature.png" width="600" />

- Set the following variables in the [.env](../notebooks/.env) file:
> **Note:** The value for **REFERENCE_DOC_SAS_URL** can be the same as **TRAINING_DATA_SAS_URL** to reuse the same blob container.
- For [analyzer_training](../notebooks/analyzer_training.ipynb): Add the SAS URL as the value of **TRAINING_DATA_SAS_URL**.
> **Note:** The value for **REFERENCE_DOC_SAS_URL** can be the same as **training_data_sas_url** to reuse the same blob container.
- For [analyzer_training](../notebooks/analyzer_training.ipynb): Add the SAS URL as the value of **training_data_sas_url**.
```env
TRAINING_DATA_SAS_URL=<Blob container SAS URL>
training_data_sas_url=<Blob container SAS URL>
```
- For [field_extraction_pro_mode](../notebooks/field_extraction_pro_mode.ipynb): Add the SAS URL as the value of **REFERENCE_DOC_SAS_URL**.
```env
Expand All @@ -53,9 +53,9 @@ The folders [document_training](../data/document_training/) and [field_extractio
5. **Set Folder Prefixes in the `.env` File:**
Depending on the sample you will run, set the required environment variables in the [.env](../notebooks/.env) file.

- For [analyzer_training](../notebooks/analyzer_training.ipynb): Add a prefix for **TRAINING_DATA_PATH**. You can choose any folder name within the blob container. For example, use `training_files`.
- For [analyzer_training](../notebooks/analyzer_training.ipynb): Add a prefix for **training_data_path**. You can choose any folder name within the blob container. For example, use `training_files`.
```env
TRAINING_DATA_PATH=<Designated folder path under the blob container>
training_data_path=<Designated folder path under the blob container>
```
- For [field_extraction_pro_mode](../notebooks/field_extraction_pro_mode.ipynb): Add a prefix for **REFERENCE_DOC_PATH**. You can choose any folder name within the blob container. For example, use `reference_docs`.
```env
Expand Down
38 changes: 37 additions & 1 deletion notebooks/.env.sample
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
AZURE_AI_ENDPOINT=
# Azure Content Understanding Service Configuration
# Copy this file to <repository-root>/.env and update with your actual values

# Your Azure Content Understanding service endpoint
# Example: https://your-resource-name.services.ai.azure.com/
# If you need help to create one, please see the Prerequisites section in:
# https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/quickstart/use-rest-api?tabs=document#prerequisites
# As of 2025/05, 2025-05-01-preview is only available in the regions documented in
# Content Understanding region and language support (https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/language-region-support).

# Azure Content Understanding Test Configuration

# Required for Content Understanding SDK and testing
AZURE_CONTENT_UNDERSTANDING_ENDPOINT=https://your-resource-name.services.ai.azure.com/

# Authentication Options:
# Option 1: Use Azure Key (FOR TESTING ONLY - Less secure)
# Set this value if you want to use key-based authentication
# WARNING: Keys are less secure and should only be used for testing/development
# Leave empty to use DefaultAzureCredential (recommended)
AZURE_CONTENT_UNDERSTANDING_KEY=

# Option 2: Use DefaultAzureCredential (RECOMMENDED for production and development)
# If AZURE_CONTENT_UNDERSTANDING_KEY is empty, the script will use DefaultAzureCredential
#
# Most common development scenario:
# 1. Install Azure CLI: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
# 2. Login: az login
# 3. Run the script (no additional configuration needed)
#
# This also supports:
# - Environment variables (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)
# - Managed Identity (for Azure-hosted applications)
# - Visual Studio Code authentication
# - Azure PowerShell authentication
# For more info: https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme#defaultazurecredential

Loading
Loading