Skip to content

Commit

Permalink
Update setup instructions and secure connection strings
Browse files Browse the repository at this point in the history
Updated program.cs in eShopAppHost project and modified README.md to include instructions for setting up user secrets for connection strings in the Products project. The new method uses `dotnet user-secrets` to securely store connection strings for `openaidev` and `azureaisearchdev`, replacing the old method of hard-coding them in configuration files.
  • Loading branch information
elbruno committed Dec 9, 2024
1 parent d435d58 commit 12c5d2f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ Open the `program.cs` in `.\src\eShopAppHost\eShopAppHost.csproj`, and comment t

Edit and define specific connection strings in the `Products` project.

Add a user secret with the configuration:
Add a user secret running the commands:

```bash
{
"ConnectionStrings:openaidev": "Endpoint=https://<endpoint>.openai.azure.com/;Key=<Azure OpenAI Service key>;",
"ConnectionStrings:azureaisearchdev": "Endpoint=https://<endpoint>.search.windows.net/;Key=<Azure AI Search key>;"
}
cd src/Products
dotnet user-secrets set "ConnectionStrings:openaidev" "Endpoint=https://<endpoint>.openai.azure.com/;Key=<Azure OpenAI Service key>;"
dotnet user-secrets set "ConnectionStrings:azureaisearchdev" "Endpoint=https://<endpoint>.search.windows.net/;Key=<Azure AI Search key>;"
```

In Debug mode, the `Products` project by default uses the User Secrets connections strings to connect to Azure AI Search and to Azure OpenAI Models. The connection strings names are `azureaisearchdev` and `openaidev`.
Expand Down

0 comments on commit 12c5d2f

Please sign in to comment.