|
7 | 7 |
|
8 | 8 | // Add Redis cache |
9 | 9 | var redis = builder.AddRedis("redis") |
10 | | - .WithRedisInsight() |
| 10 | + .WithRedisInsight(config => { |
| 11 | + config.WithLifetime(ContainerLifetime.Persistent); |
| 12 | + config.WithHostPort(8001); // Default port for RedisInsight |
| 13 | + }) |
11 | 14 | .WithLifetime(ContainerLifetime.Persistent) |
12 | 15 | .PublishAsConnectionString(); |
13 | 16 |
|
14 | 17 | // NOTE: The type returned by AddAzureStorage is IResourceBuilder<AzureStorageResource>, |
15 | 18 | // but if storage is being cast or wrapped, ensure it is of the correct type for extension methods. |
16 | 19 | var storage = builder.AddAzureStorage("azure-storage") |
17 | | - .RunAsEmulator(options => |
18 | | - { |
19 | | - // Configure the Azure Storage Emulator options here if needed |
20 | | - options.WithLifetime(ContainerLifetime.Persistent); |
21 | | - options.WithTablePort(27002); |
22 | | - options.WithBlobPort(27001); |
23 | | - options.WithQueuePort(27003); |
24 | | - }); |
| 20 | + .RunAsEmulator(options => |
| 21 | + { |
| 22 | + // Configure the Azure Storage Emulator options here if needed |
| 23 | + options.WithLifetime(ContainerLifetime.Persistent); |
| 24 | + options.WithDataVolume("copilotthatjawn-storage"); |
| 25 | + options.WithTablePort(27002); |
| 26 | + options.WithBlobPort(27001); |
| 27 | + options.WithQueuePort(27003); |
| 28 | + }); |
25 | 29 |
|
26 | 30 | var tables = storage.AddTables("tables"); |
27 | 31 | var blobs = storage.AddBlobs("blobs"); |
28 | 32 |
|
29 | 33 | var web = builder.AddProject<Web>("web") |
30 | | - .WithReference(tables) |
31 | | - .WithReference(blobs) |
32 | | - .WithReference(redis) |
33 | | - .WaitFor(tables) |
34 | | - .WaitFor(redis) |
35 | | - .WithExternalHttpEndpoints(); |
| 34 | + .WithReference(tables) |
| 35 | + .WithReference(blobs) |
| 36 | + .WithReference(redis) |
| 37 | + .WaitFor(tables) |
| 38 | + .WaitFor(redis) |
| 39 | + .WithExternalHttpEndpoints() |
| 40 | + .WithHttpCommand("/api/cache/refresh", "Refresh Cache", |
| 41 | + commandName: "refresh-cache", |
| 42 | + commandOptions: new HttpCommandOptions |
| 43 | + { |
| 44 | + Method = HttpMethod.Post, |
| 45 | + IconName = "Recycle" |
| 46 | + }); |
36 | 47 |
|
37 | 48 | builder.Build().Run(); |
0 commit comments