User Tools

Site Tools


wiki:ai:speech-translate_lab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:ai:speech-translate_lab [2025/05/21 20:42] zheinwiki:ai:speech-translate_lab [2025/05/21 20:44] (current) zhein
Line 9: Line 9:
 ===== 🔐 Azure Key Vault Setup===== ===== 🔐 Azure Key Vault Setup=====
  
-1. **Create a Key Vault** in Azure Portal.+1. **Create a Key Vault** in Azure Portal. \\
 2. Add the following **secrets**: 2. Add the following **secrets**:
  
 | Secret Name         | Example Value               | | Secret Name         | Example Value               |
-| ------------------- | --------------------------- |+--------------------------- | --------------------------- |
 | `speech-key`        | (Your Azure Speech API key) | | `speech-key`        | (Your Azure Speech API key) |
 | `speech-region`     | `eastus`                    | | `speech-region`     | `eastus`                    |
Line 53: Line 53:
 from azure.keyvault.secrets import SecretClient from azure.keyvault.secrets import SecretClient
  
-==== 🔐 Load secrets from Azure Key Vault====+🔐 Load secrets from Azure Key Vault
 VAULT_NAME = "your-keyvault-name"  # Replace with your Key Vault name VAULT_NAME = "your-keyvault-name"  # Replace with your Key Vault name
 KV_URI = f"https://{VAULT_NAME}.vault.azure.net" KV_URI = f"https://{VAULT_NAME}.vault.azure.net"
Line 59: Line 59:
 secret_client = SecretClient(vault_url=KV_URI, credential=credential) secret_client = SecretClient(vault_url=KV_URI, credential=credential)
  
-===== Fetch secrets=====+Fetch secrets
 speech_key = secret_client.get_secret("speech-key").value speech_key = secret_client.get_secret("speech-key").value
 speech_region = secret_client.get_secret("speech-region").value speech_region = secret_client.get_secret("speech-region").value
Line 106: Line 106:
  
  
-## Test result+=====Test result=====
  
 {{wiki:ai:speech-translate-result.png}} {{wiki:ai:speech-translate-result.png}}
  
wiki/ai/speech-translate_lab.1747860127.txt.gz · Last modified: by zhein