You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2025. It is now read-only.
-[Local dev using an existing model](#local-development-using-an-existing-gpt-4o-model)
17
18
-[Telemetry with .NET Aspire and Azure Application Insights](#telemetry-with-net-aspire-and-azure-application-insights)
18
19
-[Resources](#resources)
@@ -112,16 +113,57 @@ Follow these steps to run the project, locally or in CodeSpaces:
112
113
113
114
- Navigate to the Aspire Host folder project using the command:
114
115
115
-
```bash
116
-
cd ./src/eShopAppHost/
117
-
```
116
+
```bash
117
+
cd ./src/eShopAppHost/
118
+
```
119
+
120
+
- If you are running the project in Codespaces, you need to run this command:
121
+
122
+
```bash
123
+
dotnet dev-certs https --trust
124
+
```
125
+
126
+
- By default the AppHost project creates the necessary resources on Azure. Check the **[.NET Aspire Azure Resources creation](#net-aspire-azure-resources-creation)** section to learn how to configure the project to create Azure resources.
118
127
119
128
- Run the project:
120
129
121
-
```bash
122
-
dotnet run
130
+
```bash
131
+
dotnet run
132
+
````
133
+
134
+
## .NET Aspire Azure Resources creation
135
+
136
+
When utilizing Azure resources in your local development environment, you need to:
137
+
138
+
- Authenticate to the Azure Tenant where the resources will be created. Run the following command to connect with your Azure tenant:
139
+
140
+
```bash
141
+
az login
142
+
```
143
+
- Provide the necessary Configuration values are specified under the Azure section in the `eShopAppHost` project:
144
+
145
+
- CredentialSource: Delegates to the [AzureCliCredential](https://learn.microsoft.com/dotnet/api/azure.identity.azureclicredential).
146
+
- SubscriptionId: The Azure subscription ID.
147
+
- AllowResourceGroupCreation: A boolean value that indicates whether to create a new resource group.
148
+
- ResourceGroup: The name of the resource group to use.
149
+
- Location: The Azure region to use.
150
+
151
+
Consider the following example forthe *appsettings.json* filein the eShopAppHost project configuration:
152
+
153
+
```json
154
+
{
155
+
"Azure": {
156
+
"CredentialSource": "AzureCli",
157
+
"SubscriptionId": "<Your subscription id>",
158
+
"AllowResourceGroupCreation": true,
159
+
"ResourceGroup": "<Valid resource group name>",
160
+
"Location": "<Valid Azure location>"
161
+
}
162
+
}
123
163
```
124
164
165
+
Check [.NET Aspire Azure hosting integrations](https://learn.microsoft.com/en-us/dotnet/aspire/azure/local-provisioning#net-aspire-azure-hosting-integrations) for more information on how .NET Aspire create the necessary cloud resources forlocal development.
166
+
125
167
### Local development using an existing gpt-4o-mini and ada-002 model
126
168
127
169
In order to use existing models: gpt-4o-mini and text-embedding-ada-002, you need to define the specific connection string in the `Products` project.
If you are using Visual Studio 2022, you can also check the user secrets from the IDE. Right click on the `Products` project and selectthe`Manage User Secrets` option. You can add the following configuration in the IDE.
- a `text-embedding-ada-002` model named **text-embedding-ada-002**
148
183
149
-
150
-
The `Products` project add the Azure OpenAI clients using the configuration from the User Secrets in the Dev Environment. If you want to use the services provided by the `AppHost`, open the the `program.cs`, and change this:
184
+
To use these services, edit the the `program.cs`, and change this:
151
185
152
186
```csharp
153
-
// Add Azure OpenAI client
154
-
var azureOpenAiClientName = builder.Environment.IsDevelopment() ?"openaidev":"openai";
187
+
// in dev scenarios rename this to "openaidev", and check the documentation to reuse existing AOAI resources
0 commit comments