This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:ai:speech-translate_lab [2025/05/21 20:42] – zhein | wiki: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` | | `speech-key` | ||
| | `speech-region` | | `speech-region` | ||
| 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 = " | VAULT_NAME = " | ||
| KV_URI = f" | KV_URI = f" | ||
| Line 59: | Line 59: | ||
| secret_client = SecretClient(vault_url=KV_URI, | secret_client = SecretClient(vault_url=KV_URI, | ||
| - | ===== Fetch secrets===== | + | # Fetch secrets |
| speech_key = secret_client.get_secret(" | speech_key = secret_client.get_secret(" | ||
| speech_region = secret_client.get_secret(" | speech_region = secret_client.get_secret(" | ||
| Line 106: | Line 106: | ||
| - | ## Test result | + | =====Test result===== |
| {{wiki: | {{wiki: | ||