-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapphost.cs
More file actions
30 lines (24 loc) · 1.04 KB
/
apphost.cs
File metadata and controls
30 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#:sdk Aspire.AppHost.Sdk@13.0.0
#:package Aspire.Hosting.Python@13.0.0
#:package Aspire.Hosting.JavaScript@13.0.0
#:package Aspire.Hosting.Azure.CognitiveServices@13.0.0
#:package Aspire.Hosting.Azure.AIFoundry@13.0.0-preview.1.25560.3
var builder = DistributedApplication.CreateBuilder(args);
var openAiEndpoint = builder.AddParameter("openAiEndpoint");
var openAiDeployment = builder.AddParameter("openAiDeployment");
var api = builder.AddUvicornApp("agentic-api", "./src/agentic-api", "main:app")
.WithUv()
.WithEnvironment("AZURE_OPENAI_ENDPOINT", openAiEndpoint)
.WithEnvironment("AZURE_OPENAI_DEPLOYMENT_NAME", openAiDeployment)
.WithExternalHttpEndpoints();
builder.AddJavaScriptApp("agentic-ui", "./src/agentic-ui")
.WithRunScript("dev")
.WithNpm(installCommand: "ci")
.WithEnvironment("AGENT_API_URL", api.GetEndpoint("http"))
.WithReference(api)
.WaitFor(api)
.WithHttpEndpoint(env: "PORT")
.WithExternalHttpEndpoints()
.PublishAsDockerFile();
builder.Build().Run();