Skip to content

Commit

Permalink
Re-add sample apphost code
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanGiles committed Jul 11, 2024
1 parent 13048c4 commit b9cec01
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,42 @@

import com.microsoft.aspire.AppHost;
import com.microsoft.aspire.DistributedApplication;
import com.microsoft.aspire.extensions.azure.storage.AzureStorageExtension;
import com.microsoft.aspire.extensions.spring.SpringExtension;

public class StorageExplorerAppHost implements AppHost {

@Override public void configureApplication(DistributedApplication app) {
app.printExtensions();

// Create Azure Storage resources...
var blobStorage = app.withExtension(AzureStorageExtension.class)
.addAzureStorage("storage")
.addBlobs("storage-explorer-blobs");

// Create Azure OpenAI resources...
// var openAI = app.withExtension(AzureOpenAIExtension.class)
// .addAzureOpenAI("openai")
// .withDeployment(using("gpt-35-turbo", "gpt-35-turbo", "0613"));

// Let's bring Spring in to the mix...
var spring = app.withExtension(SpringExtension.class);

// Sprinkle in some Spring Eureka service discovery, so our microservices don't need to know about each other
var eurekaServiceDiscovery = spring.addEurekaServiceDiscovery("eureka");

// add our first Spring Boot project - a date service that tells us the current date / time
var dateService = spring.addSpringProject("date-service")
.withReference(eurekaServiceDiscovery)
.withExternalHttpEndpoints();

// and storage explorer - a webapp to upload / download / view resources in a storage blob container
var storageExplorer = spring.addSpringProject("storage-explorer")
.withExternalHttpEndpoints()
.withReference(blobStorage)
.withReference(eurekaServiceDiscovery)
.withOpenTelemetry();
// .withReference(openAI);
}

public static void main(String[] args) {
Expand Down

0 comments on commit b9cec01

Please sign in to comment.