Skip to content

Commit 2b74e0e

Browse files
add scripts for env file for local development server (#5)
* add scripts for env file for local development server * update readme for local server
1 parent dd80a1b commit 2b74e0e

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ You can optionally use a local development server to test app changes locally. M
137137
python -m uvicorn "api.main:create_app" --factory --reload
138138
```
139139

140-
5. Click 'http://127.0.0.1:8000' in the terminal, which should open a new tab in the browser.
140+
5. Click 'http://127.0.0.1:8000' in the terminal, which should open a new tab in the browser. It may take a few moments for application startup to complete.
141141

142142
6. Enter your message in the box.
143143

docs/deploy_customization.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To override any of those resource names, run `azd env set <key> <value>` before
3737

3838
## Customizing model deployments
3939

40-
For more information on the Azure OpenAI models and non-Microsoft models that can be used in your deployment, view the [list of models supported by Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/concepts/model-region-support)
40+
For more information on the Azure OpenAI models and non-Microsoft models that can be used in your deployment, view the [list of models supported by Azure AI Agent Service](https://learn.microsoft.com/azure/ai-services/agents/concepts/model-region-support).
4141

4242
To customize the model deployments, you can set the following environment variables:
4343

scripts/write_env.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Define the .env file path
2+
$envFilePath = "src\.env"
3+
4+
# Clear the contents of the .env file
5+
Set-Content -Path $envFilePath -Value ""
6+
7+
# Append new values to the .env file
8+
$azureAiProjectConnectionString = azd env get-value AZURE_AIPROJECT_CONNECTION_STRING
9+
$azureAiChatDeploymentName = azd env get-value AZURE_AI_CHAT_DEPLOYMENT_NAME
10+
$azureTenantId = azd env get-value AZURE_TENANT_ID
11+
12+
Add-Content -Path $envFilePath -Value "AZURE_AIPROJECT_CONNECTION_STRING=$azureAiProjectConnectionString"
13+
Add-Content -Path $envFilePath -Value "AZURE_AI_CHAT_DEPLOYMENT_NAME=$azureAiChatDeploymentName"
14+
Add-Content -Path $envFilePath -Value "AZURE_TENANT_ID=$azureTenantId"

scripts/write_env.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Define the .env file path
4+
ENV_FILE_PATH="src/.env"
5+
6+
# Clear the contents of the .env file
7+
> $ENV_FILE_PATH
8+
9+
echo "AZURE_AIPROJECT_CONNECTION_STRING=$(azd env get-value AZURE_AIPROJECT_CONNECTION_STRING)" >> $ENV_FILE_PATH
10+
echo "AZURE_AI_CHAT_DEPLOYMENT_NAME=$(azd env get-value AZURE_AI_CHAT_DEPLOYMENT_NAME)" >> $ENV_FILE_PATH
11+
echo "AZURE_TENANT_ID=$(azd env get-value AZURE_TENANT_ID)" >> $ENV_FILE_PATH

0 commit comments

Comments
 (0)