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
Copy file name to clipboardExpand all lines: docs/extensibility/dev-tunnels-integration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ The preceding code:
101
101
When another resource references a dev tunnel, environment variables are injected using the [Aspire service discovery](../service-discovery/overview.md) configuration format. Use the `WithReference` overloads that accept the `IResourceBuilder<DevTunnelResource>` parameter to reference a dev tunnel. This injects environment variables like:
Adding a reference to the "apiservice" project results in service discovery environment variables being added to the frontend. This is because typically, project-to-project communication occurs over HTTP/gRPC. For more information, see [Aspire service discovery](../service-discovery/overview.md).
182
182
@@ -202,28 +202,28 @@ var apiservice = builder.AddProject<Projects.AspireApp_ApiService>("apiservice")
The `port` parameter is the port that the container is listening on. For more information on container ports, see [Container ports](networking-overview.md#container-ports). For more information on service discovery, see [Aspire service discovery](../service-discovery/overview.md).
208
208
209
209
### Service endpoint environment variable format
210
210
211
211
In the preceding section, the <xref:Aspire.Hosting.ResourceBuilderExtensions.WithReference*> method is used to express dependencies between resources. When service endpoints result in environment variables being injected into the dependent resource, the format might not be obvious. This section provides details on this format.
212
212
213
-
When one resource depends on another resource, the AppHost injects environment variables into the dependent resource. These environment variables configure the dependent resource to connect to the resource it depends on. The format of the environment variables is specific to Aspire and expresses service endpoints in a way that is compatible with [Service Discovery](../service-discovery/overview.md).
213
+
When one resource depends on another resource, the AppHost injects environment variables into the dependent resource. These environment variables configure the dependent resource to connect to the resource it depends on. The format of the environment variables is specific to Aspire and expresses service endpoints in a way that is compatible with [Service Discovery](../service-discovery/overview.md) and polyglot scenarios.
214
214
215
-
Service endpoint environment variable names are prefixed with `services__` (double underscore), then the service name, the endpoint name, and finally the index. The index supports multiple endpoints for a single service, starting with `0` for the first endpoint and incrementing for each endpoint.
215
+
Service endpoint environment variable names follow the pattern `{RESOURCENAME}_{ENDPOINTNAME}`, where both the resource name and endpoint name are uppercased. This format is language-agnostic and works well with non-.NET technologies.
216
216
217
217
Consider the following environment variable examples:
218
218
219
219
```Environment
220
-
services__apiservice__http__0
220
+
APISERVICE_HTTP
221
221
```
222
222
223
-
The preceding environment variable expresses the first HTTP endpoint for the `apiservice` service. The value of the environment variable is the URL of the service endpoint. A named endpoint might be expressed as follows:
223
+
The preceding environment variable expresses the HTTP endpoint for the `apiservice` service. The value of the environment variable is the URL of the service endpoint. A named endpoint might be expressed as follows:
224
224
225
225
```Environment
226
-
services__apiservice__myendpoint__0
226
+
APISERVICE_MYENDPOINT
227
227
```
228
228
229
229
In the preceding example, the `apiservice` service has a named endpoint called `myendpoint`. The value of the environment variable is the URL of the service endpoint.
Copy file name to clipboardExpand all lines: docs/fundamentals/orchestrate-resources.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -285,7 +285,7 @@ var frontend = builder.AddProject<Projects.Frontend>("frontend")
285
285
.WithReference(api);
286
286
```
287
287
288
-
This configuration injects an environment variable like `services__api__https__0=https://api.example.com/` into the frontend project, enabling service discovery through the standard .NET service discovery mechanisms.
288
+
This configuration injects an environment variable like `API_HTTPS=https://api.example.com/` into the frontend project, enabling service discovery through the standard .NET service discovery mechanisms.
The Aspire AppHost sets the `services__weatherapi__http__0`environment variable, which is used to resolve the "weatherapi" service endpoint. The preceding configuration proxies HTTP requests that start with `/api` to the target URL specified in the environment variable.
150
+
The Aspire AppHost sets the `WEATHERAPI_HTTPS` and `WEATHERAPI_HTTP`environment variables, which are used to resolve the "weatherapi" service endpoints. The preceding configuration proxies HTTP requests that start with `/api` to the target URL specified in the environment variable.
151
151
152
152
Then include the proxy file to in the _angular.json_ file.
153
153
Update the `serve` target to include the `proxyConfig` option, referencing to the created _proxy.conf.js_ file.
@@ -217,7 +217,7 @@ As the `TheWelcome` integration is `mounted`, it calls the `/api/weatherforecast
Additionally, the Vite config specifies the `server.proxy` property to forward requests to the "weatherapi" service. This is achieved by using the `services__weatherapi__http__0`environment variable, which is set by the Aspire AppHost.
220
+
Additionally, the Vite config specifies the `server.proxy` property to forward requests to the "weatherapi" service. This is achieved by using the `WEATHERAPI_HTTPS` and `WEATHERAPI_HTTP`environment variables, which are set by the Aspire AppHost.
221
221
222
222
The final update from the template is made to the _TheWelcome.vue_ file. This file calls the `/api/WeatherForecast` endpoint to retrieve the weather forecast data, and displays the data in a table. It includes [CSS, HTML, and TypeScript updates](https://github.com/dotnet/aspire-samples/blob/ef6868b0999c6eea3d42a10f2b20433c5ea93720/samples/AspireWithJavaScript/AspireJavaScript.Vue/src/components/TheWelcome.vue).
0 commit comments