├── .config ├── CredScanSuppressions.json ├── PoliCheckExclusions.xml └── tsaoptions.json ├── .devcontainer └── devcontainer.json ├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ ├── labeler-cache-retention.yml │ ├── labeler-predict-issues.yml │ ├── labeler-predict-pulls.yml │ ├── labeler-promote.yml │ ├── labeler-train.yml │ └── labeler.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Directory.Build.props ├── LICENSE ├── NuGet.config ├── README.md ├── SECURITY.md ├── build.cmd ├── build.sh ├── build ├── Build.proj └── azure-pipelines.yml ├── for.dependabot.only.sln ├── global.json ├── samples ├── AspireShop │ ├── AspireShop.AppHost │ │ ├── AppHost.cs │ │ ├── AspireShop.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireShop.BasketService │ │ ├── AppHost.cs │ │ ├── AspireShop.BasketService.csproj │ │ ├── BasketService.cs │ │ ├── Models │ │ │ ├── BasketItem.cs │ │ │ ├── CustomerBasket.cs │ │ │ ├── DecimalValue.cs │ │ │ └── Order.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Protos │ │ │ └── basket.proto │ │ ├── Repositories │ │ │ ├── IBasketRepository.cs │ │ │ └── RedisBasketRepository.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireShop.CatalogDb │ │ ├── AspireShop.CatalogDb.csproj │ │ ├── CatalogBrand.cs │ │ ├── CatalogDbContext.cs │ │ ├── CatalogItem.cs │ │ └── CatalogType.cs │ ├── AspireShop.CatalogDbManager │ │ ├── AppHost.cs │ │ ├── AspireShop.CatalogDbManager.csproj │ │ ├── CatalogDbInitializer.cs │ │ ├── CatalogDbInitializerHealthCheck.cs │ │ ├── Migrations │ │ │ ├── 20241028194903_Initial.Designer.cs │ │ │ ├── 20241028194903_Initial.cs │ │ │ └── CatalogDbContextModelSnapshot.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireShop.CatalogService │ │ ├── AppHost.cs │ │ ├── AspireShop.CatalogService.csproj │ │ ├── CatalogApi.cs │ │ ├── CatalogService.http │ │ ├── Images │ │ │ ├── 1.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 13.png │ │ │ ├── 14.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ └── 9.png │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireShop.Frontend │ │ ├── AppHost.cs │ │ ├── AspireShop.Frontend.csproj │ │ ├── Components │ │ │ ├── AddToCart.razor │ │ │ ├── App.razor │ │ │ ├── Cart.razor │ │ │ ├── Layout │ │ │ │ ├── AppFooter.razor │ │ │ │ ├── MainLayout.razor │ │ │ │ └── MainLayout.razor.css │ │ │ ├── Pages │ │ │ │ ├── Error.razor │ │ │ │ ├── Home.razor │ │ │ │ └── Home.razor.css │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Services │ │ │ ├── BasketServiceClient.cs │ │ │ └── CatalogServiceClient.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── site.css │ ├── AspireShop.ServiceDefaults │ │ ├── AspireShop.ServiceDefaults.csproj │ │ ├── Extensions.cs │ │ └── ServiceReferenceExtensions.cs │ ├── AspireShop.sln │ ├── README.md │ └── images │ │ └── aspireshop-frontend-complete.png ├── AspireWithAzureFunctions │ ├── ImageGallery.AppHost │ │ ├── AppHost.cs │ │ ├── ImageGallery.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ImageGallery.FrontEnd │ │ ├── AppHost.cs │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Error.razor │ │ │ │ ├── Home.razor │ │ │ │ └── Home.razor.cs │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── ImageGallery.FrontEnd.csproj │ │ ├── ImageUrl.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── QueueMessageHandler.cs │ │ ├── StorageWorker.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── favicon.png │ │ │ └── lib │ │ │ └── bootstrap │ │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-grid.rtl.css │ │ │ ├── bootstrap-grid.rtl.css.map │ │ │ ├── bootstrap-grid.rtl.min.css │ │ │ ├── bootstrap-grid.rtl.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap-reboot.rtl.css │ │ │ ├── bootstrap-reboot.rtl.css.map │ │ │ ├── bootstrap-reboot.rtl.min.css │ │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ │ ├── bootstrap-utilities.css │ │ │ ├── bootstrap-utilities.css.map │ │ │ ├── bootstrap-utilities.min.css │ │ │ ├── bootstrap-utilities.min.css.map │ │ │ ├── bootstrap-utilities.rtl.css │ │ │ ├── bootstrap-utilities.rtl.css.map │ │ │ ├── bootstrap-utilities.rtl.min.css │ │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── bootstrap.rtl.css │ │ │ ├── bootstrap.rtl.css.map │ │ │ ├── bootstrap.rtl.min.css │ │ │ └── bootstrap.rtl.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.esm.js │ │ │ ├── bootstrap.esm.js.map │ │ │ ├── bootstrap.esm.min.js │ │ │ ├── bootstrap.esm.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ ├── ImageGallery.Functions │ │ ├── AppHost.cs │ │ ├── ImageGallery.Functions.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── ThumbnailGenerator.cs │ │ ├── host.json │ │ └── local.settings.json │ ├── ImageGallery.ServiceDefaults │ │ ├── Extensions.cs │ │ └── ImageGallery.ServiceDefaults.csproj │ ├── ImageGallery.Shared │ │ ├── ImageGallery.Shared.csproj │ │ ├── Serialization │ │ │ └── SerializationContext.cs │ │ └── UploadResult.cs │ ├── ImageGallery.sln │ ├── README.md │ └── images │ │ └── aspire-with-functions.png ├── AspireWithJavaScript │ ├── AspireJavaScript.Angular │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── angular.json │ │ ├── default.conf.template │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── proxy.conf.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ └── app.routes.ts │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ ├── styles.css │ │ │ └── types │ │ │ │ └── weatherForecast.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json │ ├── AspireJavaScript.AppHost │ │ ├── AppHost.cs │ │ ├── AspireJavaScript.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── aspire-manifest.json │ ├── AspireJavaScript.MinimalApi │ │ ├── AppHost.cs │ │ ├── AspireJavaScript.MinimalApi.csproj │ │ ├── AspireJavaScript.MinimalApi.http │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireJavaScript.React │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── default.conf.template │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ │ ├── components │ │ │ │ ├── App.css │ │ │ │ └── App.js │ │ │ ├── favicon.ico │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ └── index.js │ │ └── webpack.config.js │ ├── AspireJavaScript.ServiceDefaults │ │ ├── AspireJavaScript.ServiceDefaults.csproj │ │ └── Extensions.cs │ ├── AspireJavaScript.Vite │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── default.conf.template │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── vite.svg │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── assets │ │ │ │ └── react.svg │ │ │ ├── index.css │ │ │ ├── main.tsx │ │ │ ├── models │ │ │ │ └── Forecast.ts │ │ │ └── vite-env.d.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts │ ├── AspireJavaScript.Vue │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── .prettierrc.json │ │ ├── .vscode │ │ │ └── extensions.json │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── default.conf.template │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── src │ │ │ ├── App.vue │ │ │ ├── assets │ │ │ │ ├── base.css │ │ │ │ ├── logo.svg │ │ │ │ └── main.css │ │ │ ├── components │ │ │ │ ├── HelloWorld.vue │ │ │ │ ├── TheWelcome.vue │ │ │ │ ├── WelcomeItem.vue │ │ │ │ └── icons │ │ │ │ │ ├── IconCommunity.vue │ │ │ │ │ ├── IconDocumentation.vue │ │ │ │ │ ├── IconEcosystem.vue │ │ │ │ │ ├── IconSupport.vue │ │ │ │ │ └── IconTooling.vue │ │ │ └── main.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts │ ├── AspireJavaScript.sln │ ├── README.md │ └── images │ │ ├── angular-app.png │ │ ├── aspire-dashboard.png │ │ ├── react-app.png │ │ └── vue-app.png ├── AspireWithNode │ ├── AspireWithNode.AppHost │ │ ├── AppHost.cs │ │ ├── AspireWithNode.AppHost.csproj │ │ ├── NodeHostingExtensions.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── aspire-manifest.json │ ├── AspireWithNode.AspNetCoreApi │ │ ├── AppHost.cs │ │ ├── AspireWithNode.AspNetCoreApi.csproj │ │ ├── AspireWithNode.AspNetCoreApi.http │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireWithNode.ServiceDefaults │ │ ├── AspireWithNode.ServiceDefaults.csproj │ │ └── Extensions.cs │ ├── AspireWithNode.sln │ ├── NodeFrontend │ │ ├── .npmrc │ │ ├── Dockerfile │ │ ├── app.js │ │ ├── instrumentation.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── views │ │ │ └── index.pug │ └── README.md ├── AspireWithPython │ ├── AspireWithPython.AppHost │ │ ├── AppHost.cs │ │ ├── AspireWithPython.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── AspireWithPython.ServiceDefaults │ │ ├── AspireWithPython.ServiceDefaults.csproj │ │ └── Extensions.cs │ ├── AspireWithPython.sln │ └── InstrumentedPythonProject │ │ ├── Dockerfile │ │ ├── app.py │ │ ├── gunicorn_config.py │ │ └── requirements.txt ├── ClientAppsIntegration │ ├── ClientAppsIntegration.ApiService │ │ ├── AppHost.cs │ │ ├── ClientAppsIntegration.ApiService.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ClientAppsIntegration.AppDefaults │ │ ├── AppDefatultsExtensions.cs │ │ └── ClientAppsIntegration.AppDefaults.csproj │ ├── ClientAppsIntegration.AppHost │ │ ├── AppHost.cs │ │ ├── ClientAppsIntegration.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ClientAppsIntegration.ServiceDefaults │ │ ├── ClientAppsIntegration.ServiceDefaults.csproj │ │ └── ServiceDefaultsExtensions.cs │ ├── ClientAppsIntegration.WPF │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── AppHost.cs │ │ ├── AssemblyInfo.cs │ │ ├── ClientAppsIntegration.WPF.csproj │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── WeatherApiClient.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ └── appsettings.json │ ├── ClientAppsIntegration.WinForms │ │ ├── AppHost.cs │ │ ├── ClientAppsIntegration.WinForms.csproj │ │ ├── MainForm.Designer.cs │ │ ├── MainForm.cs │ │ ├── MainForm.resx │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── WeatherApiClient.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ └── appsettings.json │ ├── ClientAppsIntegration.sln │ ├── README.md │ └── images │ │ └── client-apps-dashboard-winforms.png ├── ContainerBuild │ ├── ContainerBuild.AppHost │ │ ├── AppHost.cs │ │ ├── ContainerBuild.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ContainerBuild.sln │ ├── README.md │ ├── ginapp │ │ ├── Dockerfile │ │ ├── ginapp.go │ │ ├── go.mod │ │ └── go.sum │ └── images │ │ └── aspire-dashboard-container-build.png ├── CustomResources │ ├── .aspire │ │ └── settings.json │ ├── CustomResources.AppHost │ │ ├── AppHost.cs │ │ ├── CustomResources.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── TalkingClockResource.cs │ │ ├── TestResource.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── CustomResources.sln │ └── README.md ├── DatabaseContainers │ ├── DatabaseContainers.ApiService │ │ ├── ApiEndpoints.cs │ │ ├── AppHost.cs │ │ ├── DatabaseContainers.ApiService.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── data │ │ │ ├── mysql │ │ │ └── init.sql │ │ │ ├── postgres │ │ │ └── init.sql │ │ │ └── sqlserver │ │ │ └── init.sql │ ├── DatabaseContainers.AppHost │ │ ├── AppHost.cs │ │ ├── DatabaseContainers.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── DatabaseContainers.ServiceDefaults │ │ ├── DatabaseContainers.ServiceDefaults.csproj │ │ └── Extensions.cs │ ├── DatabaseContainers.sln │ ├── README.md │ └── images │ │ └── db-containers-apiservice-swagger-ui.png ├── DatabaseMigrations │ ├── DatabaseMigrations.ApiModel │ │ ├── DatabaseMigrations.ApiModel.csproj │ │ └── MyDb1Context.cs │ ├── DatabaseMigrations.ApiService │ │ ├── AppHost.cs │ │ ├── DatabaseMigrations.ApiService.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── DatabaseMigrations.AppHost │ │ ├── AppHost.cs │ │ ├── DatabaseMigrations.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── DatabaseMigrations.MigrationService │ │ ├── ApiDbInitializer.cs │ │ ├── AppHost.cs │ │ ├── DatabaseMigrations.MigrationService.csproj │ │ └── Migrations │ │ │ ├── 20241028195151_Initial.Designer.cs │ │ │ ├── 20241028195151_Initial.cs │ │ │ └── MyDb1ContextModelSnapshot.cs │ ├── DatabaseMigrations.ServiceDefaults │ │ ├── DatabaseMigrations.ServiceDefaults.csproj │ │ └── Extensions.cs │ ├── DatabaseMigrations.sln │ └── README.md ├── HealthChecksUI │ ├── HealthChecksUI.ApiService │ │ ├── AppHost.cs │ │ ├── HealthChecksUI.ApiService.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── HealthChecksUI.AppHost │ │ ├── AppHost.cs │ │ ├── HealthChecksUI.AppHost.csproj │ │ ├── HealthChecksUIExtensions.cs │ │ ├── HealthChecksUIResource.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── aspire-manifest.json │ ├── HealthChecksUI.ServiceDefaults │ │ ├── Extensions.cs │ │ └── HealthChecksUI.ServiceDefaults.csproj │ ├── HealthChecksUI.Web │ │ ├── AppHost.cs │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Counter.razor │ │ │ │ ├── Error.razor │ │ │ │ ├── Home.razor │ │ │ │ └── Weather.razor │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── HealthChecksUI.Web.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── WeatherApiClient.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── favicon.png │ ├── HealthChecksUI.sln │ ├── README.md │ └── images │ │ ├── aca-diagram.svg │ │ └── healthchecksui.png ├── Metrics │ ├── Metrics.sln │ ├── MetricsApp.AppHost │ │ ├── AppHost.cs │ │ ├── MetricsApp.AppHost.csproj │ │ ├── OpenTelemetryCollector │ │ │ ├── OpenTelemetryCollectorLifecycleHook.cs │ │ │ ├── OpenTelemetryCollectorResource.cs │ │ │ ├── OpenTelemetryCollectorResourceBuilderExtensions.cs │ │ │ ├── OpenTelemetryCollectorServiceExtensions.cs │ │ │ └── README.md │ │ ├── Properties │ │ │ └── launchSettings.json │ │ └── appsettings.json │ ├── MetricsApp.Client │ │ ├── App.razor │ │ ├── AppHost.cs │ │ ├── Auth │ │ │ ├── IdentityAuthenticationStateProvider.cs │ │ │ ├── IdentityHttpHandler.cs │ │ │ └── UserInfo.cs │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ ├── MainLayout.razor.css │ │ │ ├── NavMenu.razor │ │ │ └── NavMenu.razor.css │ │ ├── MetricsApp.Client.csproj │ │ ├── Pages │ │ │ ├── Auth.razor │ │ │ ├── Home.razor │ │ │ └── Weather.razor │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Shared │ │ │ ├── RedirectToLogin.razor │ │ │ └── StatusMessage.razor │ │ ├── _Imports.razor │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── app.css │ │ │ └── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── favicon.png │ │ │ ├── icon-192.png │ │ │ └── index.html │ ├── MetricsApp │ │ ├── AppHost.cs │ │ ├── Auth.cs │ │ ├── ClientApi.cs │ │ ├── MetricsApp.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── README.md │ ├── ServiceDefaults │ │ ├── Extensions.cs │ │ └── ServiceDefaults.csproj │ ├── grafana │ │ ├── config │ │ │ ├── grafana.ini │ │ │ └── provisioning │ │ │ │ ├── dashboards │ │ │ │ └── default.yaml │ │ │ │ └── datasources │ │ │ │ └── default.yaml │ │ └── dashboards │ │ │ ├── aspnetcore-endpoint.json │ │ │ └── aspnetcore.json │ ├── images │ │ └── dashboard-screenshot.png │ ├── otelcollector │ │ └── config.yaml │ └── prometheus │ │ └── prometheus.yml ├── OrleansVoting │ ├── OrleansVoting.AppHost │ │ ├── AppHost.cs │ │ ├── OrleansVoting.AppHost.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── OrleansVoting.Service │ │ ├── App.razor │ │ ├── AppHost.cs │ │ ├── Controllers │ │ │ ├── HomeController.cs │ │ │ └── VotesController.cs │ │ ├── Data │ │ │ ├── DemoService.cs │ │ │ ├── PollService.PollWatcherSubscription.cs │ │ │ └── PollService.cs │ │ ├── Grains │ │ │ ├── IPollGrain.cs │ │ │ ├── IPollWatcher.cs │ │ │ ├── IUserAgentGrain.cs │ │ │ ├── IVoteGrain.cs │ │ │ ├── PollGrain.cs │ │ │ ├── UserAgentGrain.cs │ │ │ └── VoteGrain.cs │ │ ├── Helpers │ │ │ └── ThrottlingException.cs │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ ├── OrleansVoting.Service.csproj │ │ ├── Pages │ │ │ ├── Error.cshtml │ │ │ ├── Error.cshtml.cs │ │ │ ├── Index.razor │ │ │ ├── Poll.razor │ │ │ ├── PollEditor.razor │ │ │ ├── _Host.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── MainLayout.razor.css │ │ │ ├── NavMenu.razor │ │ │ └── NavMenu.razor.css │ │ ├── Startup.cs │ │ ├── _Imports.razor │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── open-iconic │ │ │ │ ├── FONT-LICENSE │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── font │ │ │ │ │ ├── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.svg │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── Orleans.svg │ │ │ └── favicon.png │ │ │ ├── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ │ └── lib │ │ │ ├── angular-bootstrap │ │ │ └── ui-bootstrap-tpls.min.js │ │ │ ├── angular │ │ │ └── angular.min.js │ │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ └── jquery.min.js │ ├── OrleansVoting.ServiceDefaults │ │ ├── Extensions.cs │ │ └── OrleansVoting.ServiceDefaults.csproj │ ├── OrleansVoting.sln │ └── README.md ├── Shared │ ├── DevCertHostingExtensions.cs │ └── RetryingSqlServerRetryingExecutionStrategy.cs ├── StandaloneDashboard │ ├── ConsoleApp │ │ ├── AppHost.cs │ │ ├── ConsoleApp.csproj │ │ ├── NuGetDownloader.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── README.md │ ├── StandaloneDashboard.sln │ └── images │ │ ├── aspire-dashboard-container-log.png │ │ └── aspire-dashboard-screenshot.png └── VolumeMount │ ├── README.md │ ├── VolumeMount.AppHost │ ├── AppHost.cs │ ├── Properties │ │ └── launchSettings.json │ ├── VolumeMount.AppHost.csproj │ ├── appsettings.Development.json │ └── appsettings.json │ ├── VolumeMount.BlazorWeb │ ├── AppHost.cs │ ├── Components │ │ ├── Account │ │ │ ├── IdentityComponentsEndpointRouteBuilderExtensions.cs │ │ │ ├── IdentityNoOpEmailSender.cs │ │ │ ├── IdentityRedirectManager.cs │ │ │ ├── IdentityRevalidatingAuthenticationStateProvider.cs │ │ │ ├── IdentityUserAccessor.cs │ │ │ ├── Pages │ │ │ │ ├── ConfirmEmail.razor │ │ │ │ ├── ConfirmEmailChange.razor │ │ │ │ ├── ExternalLogin.razor │ │ │ │ ├── ForgotPassword.razor │ │ │ │ ├── ForgotPasswordConfirmation.razor │ │ │ │ ├── InvalidPasswordReset.razor │ │ │ │ ├── InvalidUser.razor │ │ │ │ ├── Lockout.razor │ │ │ │ ├── Login.razor │ │ │ │ ├── LoginWith2fa.razor │ │ │ │ ├── LoginWithRecoveryCode.razor │ │ │ │ ├── Manage │ │ │ │ │ ├── ChangePassword.razor │ │ │ │ │ ├── DeletePersonalData.razor │ │ │ │ │ ├── Disable2fa.razor │ │ │ │ │ ├── Email.razor │ │ │ │ │ ├── EnableAuthenticator.razor │ │ │ │ │ ├── ExternalLogins.razor │ │ │ │ │ ├── GenerateRecoveryCodes.razor │ │ │ │ │ ├── Index.razor │ │ │ │ │ ├── PersonalData.razor │ │ │ │ │ ├── ResetAuthenticator.razor │ │ │ │ │ ├── SetPassword.razor │ │ │ │ │ ├── TwoFactorAuthentication.razor │ │ │ │ │ └── _Imports.razor │ │ │ │ ├── Register.razor │ │ │ │ ├── RegisterConfirmation.razor │ │ │ │ ├── ResendEmailConfirmation.razor │ │ │ │ ├── ResetPassword.razor │ │ │ │ ├── ResetPasswordConfirmation.razor │ │ │ │ └── _Imports.razor │ │ │ └── Shared │ │ │ │ ├── AccountLayout.razor │ │ │ │ ├── ExternalLoginPicker.razor │ │ │ │ ├── ManageLayout.razor │ │ │ │ ├── ManageNavMenu.razor │ │ │ │ ├── RedirectToLogin.razor │ │ │ │ ├── ShowRecoveryCodes.razor │ │ │ │ └── StatusMessage.razor │ │ ├── App.razor │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ ├── MainLayout.razor.css │ │ │ ├── NavMenu.razor │ │ │ └── NavMenu.razor.css │ │ ├── Pages │ │ │ ├── Auth.razor │ │ │ ├── Counter.razor │ │ │ ├── Error.razor │ │ │ ├── Home.razor │ │ │ └── Weather.razor │ │ ├── Routes.razor │ │ └── _Imports.razor │ ├── Data │ │ ├── ApplicationDbContext.cs │ │ ├── ApplicationUser.cs │ │ └── PostgresDbContext.cs │ ├── Migrations │ │ ├── 20241028195630_CreateIdentitySchema.Designer.cs │ │ ├── 20241028195630_CreateIdentitySchema.cs │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Properties │ │ ├── launchSettings.json │ │ ├── serviceDependencies.json │ │ └── serviceDependencies.local.json │ ├── VolumeMount.BlazorWeb.csproj │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── app.css │ │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── favicon.png │ ├── VolumeMount.ServiceDefaults │ ├── Extensions.cs │ └── VolumeMount.ServiceDefaults.csproj │ ├── VolumeMount.sln │ └── images │ ├── volume-mount-frontend-account-registered.png │ ├── volume-mount-frontend-dbcontext-error.png │ ├── volume-mount-frontend-email-confirmed.png │ ├── volume-mount-frontend-login.png │ └── volume-mount-frontend-register.png └── tests ├── SamplesIntegrationTests ├── AppHostTests.cs ├── Infrastructure │ ├── DistributedApplicationExtensions.cs │ ├── DistributedApplicationTestFactory.cs │ ├── PasswordGenerator.cs │ └── ResourceExtensions.cs ├── SamplesIntegrationTests.csproj └── xunit.runner.json └── SamplesTests.sln /.config/CredScanSuppressions.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.config/PoliCheckExclusions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | angular.min.js 4 | 5 | -------------------------------------------------------------------------------- /.config/tsaoptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "instanceUrl": "https://devdiv.visualstudio.com/", 3 | "template": "TFSDEVDIV", 4 | "projectName": "DEVDIV", 5 | "areaPath": "DevDiv\\ASP.NET Core\\Policy Violations", 6 | "iterationPath": "DevDiv", 7 | "notificationAliases": [ "aspnetcore-build@microsoft.com" ], 8 | "repositoryName": "aspire-samples", 9 | "codebaseName": "aspire-samples" 10 | } -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": ".NET Aspire Samples", 3 | "image": "mcr.microsoft.com/devcontainers/dotnet:dev-9.0-bookworm", 4 | "features": { 5 | "ghcr.io/devcontainers/features/azure-cli:1": {}, 6 | "ghcr.io/azure/azure-dev/azd:0": {}, 7 | "ghcr.io/devcontainers/features/docker-in-docker": {}, 8 | "ghcr.io/dotnet/aspire-devcontainer-feature/dotnetaspire:1": {}, 9 | "ghcr.io/devcontainers/features/node:1": {}, 10 | "ghcr.io/devcontainers/features/python:1": {} 11 | }, 12 | "hostRequirements": { 13 | "cpus": 8, 14 | "memory": "32gb", 15 | "storage": "64gb" 16 | }, 17 | "customizations": { 18 | "vscode": { 19 | "extensions": [ 20 | "ms-azuretools.azure-dev", 21 | "GitHub.copilot", 22 | "GitHub.copilot-chat" 23 | ], 24 | "settings": { 25 | "remote.autoForwardPorts": true, 26 | "remote.autoForwardPortsSource": "hybrid", 27 | "remote.otherPortsAttributes": { 28 | "onAutoForward": "ignore" 29 | }, 30 | "dotnet.defaultSolution": "samples/AspireShop/AspireShop.sln" 31 | } 32 | } 33 | }, 34 | "postStartCommand": "dotnet dev-certs https --trust" 35 | } 36 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the code of conduct defined by the Contributor Covenant 4 | to clarify expected behavior in our community. 5 | For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | 6 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | dotnet build .\build\Build.proj -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | dotnet build ./build/Build.proj -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.100", 4 | "rollForward": "feature", 5 | "allowPrerelease": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.AppHost/AspireShop.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 1d56e163-c575-42ac-a0a7-c6484d1729d9 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/AppHost.cs: -------------------------------------------------------------------------------- 1 | using AspireShop.BasketService; 2 | using AspireShop.BasketService.Repositories; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | builder.AddServiceDefaults(); 7 | builder.AddRedisClient("basketcache"); 8 | 9 | builder.Services.AddGrpc(); 10 | builder.Services.AddGrpcHealthChecks(); 11 | builder.Services.AddTransient(); 12 | 13 | var app = builder.Build(); 14 | 15 | app.MapGrpcService(); 16 | 17 | app.MapGrpcHealthChecksService(); 18 | 19 | app.MapDefaultEndpoints(); 20 | 21 | app.Run(); 22 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/AspireShop.BasketService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/Models/BasketItem.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AspireShop.BasketService.Models; 4 | 5 | public class BasketItem : IValidatableObject 6 | { 7 | public string? Id { get; set; } 8 | public int ProductId { get; set; } 9 | public decimal UnitPrice { get; set; } 10 | public decimal OldUnitPrice { get; set; } 11 | public int Quantity { get; set; } 12 | 13 | public IEnumerable Validate(ValidationContext validationContext) 14 | { 15 | List? results = null; 16 | 17 | if (Quantity < 1) 18 | { 19 | results = [ new("Invalid number of units", [ "Quantity" ]) ]; 20 | } 21 | 22 | return results ?? Enumerable.Empty(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/Models/CustomerBasket.cs: -------------------------------------------------------------------------------- 1 | namespace AspireShop.BasketService.Models; 2 | 3 | public class CustomerBasket 4 | { 5 | public string? BuyerId { get; set; } 6 | 7 | public List Items { get; set; } = new(); 8 | 9 | public int TotalItemCount => Items.Sum(i => i.Quantity); 10 | 11 | public CustomerBasket() 12 | { 13 | } 14 | 15 | public CustomerBasket(string customerId) 16 | { 17 | BuyerId = customerId; 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/Models/DecimalValue.cs: -------------------------------------------------------------------------------- 1 | namespace AspireShop.GrpcBasket; 2 | 3 | public partial class DecimalValue 4 | { 5 | private const decimal NanoFactor = 1_000_000_000; 6 | public DecimalValue(long units, int nanos) 7 | { 8 | Units = units; 9 | Nanos = nanos; 10 | } 11 | 12 | public static implicit operator decimal(DecimalValue grpcDecimal) 13 | { 14 | return grpcDecimal.Units + grpcDecimal.Nanos / NanoFactor; 15 | } 16 | 17 | public static implicit operator DecimalValue(decimal value) 18 | { 19 | var units = decimal.ToInt64(value); 20 | var nanos = decimal.ToInt32((value - units) * NanoFactor); 21 | return new DecimalValue(units, nanos); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/Models/Order.cs: -------------------------------------------------------------------------------- 1 | namespace AspireShop.BasketService.Models; 2 | 3 | public class Order 4 | { 5 | public required string Id { get; set; } 6 | public string? BuyerId { get; set; } 7 | 8 | public List Items { get; set; } = new(); 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": false, 8 | "applicationUrl": "http://localhost:5309", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": false, 17 | "applicationUrl": "https://localhost:7309;http://localhost:5309", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/Repositories/IBasketRepository.cs: -------------------------------------------------------------------------------- 1 | using AspireShop.BasketService.Models; 2 | 3 | namespace AspireShop.BasketService.Repositories; 4 | 5 | public interface IBasketRepository 6 | { 7 | Task GetBasketAsync(string customerId); 8 | IEnumerable GetUsers(); 9 | Task UpdateBasketAsync(CustomerBasket basket); 10 | Task DeleteBasketAsync(string id); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.BasketService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Azure": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "Kestrel": { 11 | "EndpointDefaults": { 12 | "Protocols": "Http2" 13 | } 14 | }, 15 | "Aspire": { 16 | "StackExchange": { 17 | "Redis": { 18 | "ConfigurationOptions": { 19 | "ConnectRetry": 5 20 | } 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDb/AspireShop.CatalogDb.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDb/CatalogBrand.cs: -------------------------------------------------------------------------------- 1 | namespace AspireShop.CatalogDb; 2 | 3 | public class CatalogBrand 4 | { 5 | public int Id { get; set; } 6 | public required string Brand { get; set; } 7 | } 8 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDb/CatalogItem.cs: -------------------------------------------------------------------------------- 1 | namespace AspireShop.CatalogDb; 2 | 3 | public class CatalogItem 4 | { 5 | public int Id { get; set; } 6 | public required string Name { get; set; } 7 | public string? Description { get; set; } 8 | public decimal Price { get; set; } 9 | public required string PictureFileName { get; set; } 10 | public string? PictureUri { get; set; } 11 | 12 | public int CatalogTypeId { get; set; } 13 | public required CatalogType CatalogType { get; set; } 14 | 15 | public int CatalogBrandId { get; set; } 16 | public required CatalogBrand CatalogBrand { get; set; } 17 | public int AvailableStock { get; set; } 18 | public int RestockThreshold { get; set; } 19 | public int MaxStockThreshold { get; set; } 20 | public bool OnReorder { get; set; } 21 | } 22 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDb/CatalogType.cs: -------------------------------------------------------------------------------- 1 | namespace AspireShop.CatalogDb; 2 | 3 | public class CatalogType 4 | { 5 | public int Id { get; set; } 6 | public required string Type { get; set; } 7 | } 8 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDbManager/AspireShop.CatalogDbManager.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDbManager/CatalogDbInitializerHealthCheck.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Diagnostics.HealthChecks; 2 | 3 | namespace AspireShop.CatalogDbManager; 4 | 5 | internal class CatalogDbInitializerHealthCheck(CatalogDbInitializer dbInitializer) : IHealthCheck 6 | { 7 | public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) 8 | { 9 | var task = dbInitializer.ExecuteTask; 10 | 11 | return task switch 12 | { 13 | { IsCompletedSuccessfully: true } => Task.FromResult(HealthCheckResult.Healthy()), 14 | { IsFaulted: true } => Task.FromResult(HealthCheckResult.Unhealthy(task.Exception?.InnerException?.Message, task.Exception)), 15 | { IsCanceled: true } => Task.FromResult(HealthCheckResult.Unhealthy("Database initialization was canceled")), 16 | _ => Task.FromResult(HealthCheckResult.Degraded("Database initialization is still in progress")) 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDbManager/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "http": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "launchUrl": "health", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | }, 10 | "applicationUrl": "http://localhost:52242" 11 | }, 12 | "https": { 13 | "commandName": "Project", 14 | "launchBrowser": true, 15 | "launchUrl": "health", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | }, 19 | "applicationUrl": "https://localhost:52241;http://localhost:52242" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDbManager/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | // A connection string is here to enable use of the `dotnet ef` cmd line tool from the project root. 10 | // If the configuration value is not present or not well-formed, the app will fail at startup. 11 | // Note that some commands require the connection string to point to a real database in order to fully 12 | // function (e.g. `dotnet ef database update`, `dotnet ef migrations list`). 13 | "catalogdb": "Server=localhost;Port=5432;Database=NOT_A_REAL_DB" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogDbManager/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Microsoft.EntityFrameworkCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/AppHost.cs: -------------------------------------------------------------------------------- 1 | using AspireShop.CatalogDb; 2 | using AspireShop.CatalogService; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | builder.AddServiceDefaults(); 7 | builder.AddNpgsqlDbContext("catalogdb"); 8 | 9 | builder.Services.AddEndpointsApiExplorer(); 10 | builder.Services.AddProblemDetails(); 11 | builder.Services.AddSwaggerGen(); 12 | 13 | var app = builder.Build(); 14 | 15 | if (app.Environment.IsDevelopment()) 16 | { 17 | app.UseSwagger(); 18 | app.UseSwaggerUI(); 19 | } 20 | else 21 | { 22 | app.UseExceptionHandler(); 23 | } 24 | 25 | app.MapCatalogApi(); 26 | app.MapDefaultEndpoints(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/AspireShop.CatalogService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | 16965dbf-c1f8-4682-b7d8-e250bc520544 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/CatalogService.http: -------------------------------------------------------------------------------- 1 | @MyBackend_HostAddress = http://localhost:5241 2 | 3 | GET {{MyBackend_HostAddress}}/api/v1/catalog/items/type/all/brand 4 | Accept: application/json 5 | 6 | ### 7 | 8 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/1.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/10.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/11.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/12.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/13.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/14.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/2.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/3.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/4.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/5.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/6.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/7.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/8.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Images/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/AspireShop.CatalogService/Images/9.png -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": false, 8 | "launchUrl": "swagger", 9 | "applicationUrl": "http://localhost:5241", 10 | "environmentVariables": { 11 | "ASPNETCORE_ENVIRONMENT": "Development" 12 | } 13 | }, 14 | "https": { 15 | "commandName": "Project", 16 | "dotnetRunMessages": true, 17 | "launchBrowser": false, 18 | "launchUrl": "swagger", 19 | "applicationUrl": "https://localhost:7241;http://localhost:5241", 20 | "environmentVariables": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "catalogdb": "Run this project via the AppHost to ensure this value is populated with a valid connection string" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.CatalogService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/AddToCart.razor: -------------------------------------------------------------------------------- 1 | @inject BasketServiceClient BasketClient 2 | @inject NavigationManager Navigation 3 | 4 | 5 | 6 | 9 | 10 | 11 | @code { 12 | [Parameter] 13 | [EditorRequired] 14 | public required CatalogItem Item { get; set; } 15 | 16 | [SupplyParameterFromForm] 17 | public int ItemId { get; set; } 18 | 19 | private async Task HandleAddToCart() 20 | { 21 | await BasketClient.AddToCartAsync("user", ItemId); 22 | 23 | // Preserve query string 24 | Navigation.NavigateTo($"/{new Uri(Navigation.Uri).Query}"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/Layout/AppFooter.razor: -------------------------------------------------------------------------------- 1 | @using System.Runtime.InteropServices 2 | 3 | 25 | 26 | @code { 27 | string Message = $"Powered by {RuntimeInformation.FrameworkDescription}"; 28 | } -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | @Body 4 | 5 |
6 | An unhandled error has occurred. 7 | Reload 8 | 🗙 9 |
10 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | 3 | @using System.Diagnostics 4 | 5 | Error 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (showRequestId) 11 | { 12 |

13 | Request ID: @requestId 14 |

15 | } 16 | 17 | @code { 18 | private string? requestId; 19 | private bool showRequestId => !string.IsNullOrEmpty(requestId); 20 | 21 | [CascadingParameter] 22 | public HttpContext? HttpContext { get; set; } 23 | 24 | protected override void OnInitialized() 25 | { 26 | requestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/Pages/Home.razor.css: -------------------------------------------------------------------------------- 1 | .catalog-loading { 2 | min-height: 500px; 3 | } 4 | 5 | .catalog-item-image { 6 | min-height: 295px; 7 | } -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using AspireShop.Frontend 10 | @using AspireShop.Frontend.Components 11 | @using AspireShop.Frontend.Components.Layout 12 | @using AspireShop.Frontend.Services 13 | @using AspireShop.BasketService.Models 14 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": false, 8 | "applicationUrl": "http://localhost:5276", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": false, 17 | "applicationUrl": "https://localhost:7276;http://localhost:5276", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft.AspNetCore": "Debug" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireShop/AspireShop.Frontend/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | }, 7 | "Console": { 8 | "FormatterOptions": { 9 | "SingleLine": true 10 | } 11 | } 12 | }, 13 | "AllowedHosts": "*" 14 | } 15 | -------------------------------------------------------------------------------- /samples/AspireShop/images/aspireshop-frontend-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireShop/images/aspireshop-frontend-complete.png -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.AppHost/ImageGallery.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net9.0 8 | enable 9 | enable 10 | e4145abc-ffce-4abc-8946-4083dce0f67e 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 12 |
13 | 14 |
15 | @Body 16 |
17 |
18 |
19 | 20 |
21 | An unhandled error has occurred. 22 | Reload 23 | 🗙 24 |
25 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using ImageGallery.FrontEnd 10 | @using ImageGallery.FrontEnd.Components 11 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/ImageGallery.FrontEnd.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5279", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7041;http://localhost:5279", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/QueueMessageHandler.cs: -------------------------------------------------------------------------------- 1 | using ImageGallery.Shared; 2 | 3 | namespace ImageGallery.FrontEnd; 4 | 5 | public sealed class QueueMessageHandler 6 | { 7 | public event Func? MessageReceived; 8 | 9 | public Task OnMessageReceivedAsync(UploadResult? result) 10 | { 11 | if (result is null) 12 | { 13 | return Task.CompletedTask; 14 | } 15 | 16 | return MessageReceived?.Invoke(result) ?? Task.CompletedTask; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithAzureFunctions/ImageGallery.FrontEnd/wwwroot/favicon.png -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Functions/AppHost.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker.Builder; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | var builder = FunctionsApplication.CreateBuilder(args); 5 | 6 | builder.AddServiceDefaults(); 7 | 8 | builder.AddAzureQueueClient("queues"); 9 | builder.AddAzureBlobClient("blobs"); 10 | 11 | builder.ConfigureFunctionsWebApplication(); 12 | 13 | builder.Build().Run(); 14 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Functions/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ImageGalleryFunctions": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7221", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Functions/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | }, 9 | "enableLiveMetricsFilters": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Functions/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" 6 | } 7 | } -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.ServiceDefaults/ImageGallery.ServiceDefaults.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Shared/ImageGallery.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Shared/Serialization/SerializationContext.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ImageGallery.Shared.Serialization; 4 | 5 | [JsonSerializable(typeof(UploadResult))] 6 | public sealed partial class SerializationContext : JsonSerializerContext 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/ImageGallery.Shared/UploadResult.cs: -------------------------------------------------------------------------------- 1 | namespace ImageGallery.Shared; 2 | 3 | public sealed record class UploadResult(string Name, bool IsSuccessful); 4 | -------------------------------------------------------------------------------- /samples/AspireWithAzureFunctions/images/aspire-with-functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithAzureFunctions/images/aspire-with-functions.png -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 as build 2 | 3 | WORKDIR /app 4 | 5 | COPY package.json package.json 6 | COPY package-lock.json package-lock.json 7 | 8 | RUN npm install 9 | 10 | COPY . . 11 | 12 | RUN npm run build 13 | 14 | FROM nginx:alpine 15 | 16 | COPY --from=build /app/default.conf.template /etc/nginx/templates/default.conf.template 17 | COPY --from=build /app/dist/weather/browser /usr/share/nginx/html 18 | 19 | # Expose the default nginx port 20 | EXPOSE 80 21 | 22 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/default.conf.template: -------------------------------------------------------------------------------- 1 | server { 2 | listen ${PORT}; 3 | listen [::]:${PORT}; 4 | server_name localhost; 5 | 6 | access_log /var/log/nginx/server.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | try_files $uri $uri/ /index.html; 11 | } 12 | 13 | location /api/ { 14 | proxy_pass ${services__weatherapi__https__0}; 15 | proxy_http_version 1.1; 16 | proxy_ssl_server_name on; 17 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 18 | rewrite ^/api(/.*)$ $1 break; 19 | } 20 | } -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/proxy.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "/api": { 3 | target: 4 | process.env["services__weatherapi__https__0"] || 5 | process.env["services__weatherapi__http__0"], 6 | secure: process.env["NODE_ENV"] !== "development", 7 | pathRewrite: { 8 | "^/api": "", 9 | }, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [AppComponent], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it(`should have the 'weather' title`, () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app.title).toEqual('weather'); 21 | }); 22 | 23 | it('should render title', () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | fixture.detectChanges(); 26 | const compiled = fixture.nativeElement as HTMLElement; 27 | expect(compiled.querySelector('h1')?.textContent).toContain('Hello, weather'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injectable } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterOutlet } from '@angular/router'; 4 | import { HttpClient } from '@angular/common/http'; 5 | import { WeatherForecasts } from '../types/weatherForecast'; 6 | 7 | @Injectable() 8 | @Component({ 9 | selector: 'app-root', 10 | standalone: true, 11 | imports: [CommonModule, RouterOutlet], 12 | templateUrl: './app.component.html', 13 | styleUrl: './app.component.css' 14 | }) 15 | export class AppComponent { 16 | title = 'weather'; 17 | forecasts: WeatherForecasts = []; 18 | 19 | constructor(private http: HttpClient) { 20 | http.get('api/weatherforecast').subscribe({ 21 | next: result => this.forecasts = result, 22 | error: console.error 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig } from '@angular/core'; 2 | import { provideHttpClient } from '@angular/common/http'; 3 | import { provideRouter } from '@angular/router'; 4 | 5 | import { routes } from './app.routes'; 6 | 7 | export const appConfig: ApplicationConfig = { 8 | providers: [ 9 | provideRouter(routes), 10 | provideHttpClient() 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/AspireJavaScript.Angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/AspireJavaScript.Angular/src/favicon.ico -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Weather 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig) 6 | .catch((err) => console.error(err)); 7 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/src/types/weatherForecast.ts: -------------------------------------------------------------------------------- 1 | export interface WeatherForecast { 2 | date: string; 3 | temperatureC: number; 4 | temperatureF: number; 5 | summary: string; 6 | } 7 | 8 | export type WeatherForecasts = WeatherForecast[]; -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/out-tsc", 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "noImplicitOverride": true, 9 | "noPropertyAccessFromIndexSignature": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "skipLibCheck": true, 13 | "esModuleInterop": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": false, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.MinimalApi/AspireJavaScript.MinimalApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.MinimalApi/AspireJavaScript.MinimalApi.http: -------------------------------------------------------------------------------- 1 | @AspireJavaScript.MinimalApi_HostAddress = http://localhost:5084 2 | 3 | GET {{AspireJavaScript.MinimalApi_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.MinimalApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:27774", 8 | "sslPort": 44307 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "http://localhost:5084", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "swagger", 27 | "applicationUrl": "https://localhost:7167;http://localhost:5084", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.MinimalApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.MinimalApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /dist 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 as build 2 | 3 | WORKDIR /app 4 | 5 | COPY package.json package.json 6 | COPY package-lock.json package-lock.json 7 | 8 | RUN npm install 9 | 10 | COPY . . 11 | 12 | RUN npm run build 13 | 14 | FROM nginx:alpine 15 | 16 | COPY --from=build /app/default.conf.template /etc/nginx/templates/default.conf.template 17 | COPY --from=build /app/dist /usr/share/nginx/html 18 | 19 | # Expose the default nginx port 20 | EXPOSE 80 21 | 22 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/default.conf.template: -------------------------------------------------------------------------------- 1 | server { 2 | listen ${PORT}; 3 | listen [::]:${PORT}; 4 | server_name localhost; 5 | 6 | access_log /var/log/nginx/server.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | try_files $uri $uri/ /index.html; 11 | } 12 | 13 | location /api/ { 14 | proxy_pass ${services__weatherapi__https__0}; 15 | proxy_http_version 1.1; 16 | proxy_ssl_server_name on; 17 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 18 | rewrite ^/api(/.*)$ $1 break; 19 | } 20 | } -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-weather", 3 | "version": "0.1.0", 4 | "private": true, 5 | "engines": { 6 | "node": ">=20.12" 7 | }, 8 | "scripts": { 9 | "build": "webpack --mode production --config webpack.config.js", 10 | "start": "run-script-os", 11 | "start:win32": "webpack-dev-server --mode development --hot --env PORT=%PORT%", 12 | "start:default": "webpack-dev-server --mode development --hot --env PORT=$PORT" 13 | }, 14 | "dependencies": { 15 | "react": "^19.0.0", 16 | "react-dom": "^19.0.0" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.26.9", 20 | "@babel/preset-env": "^7.26.9", 21 | "@babel/preset-react": "^7.26.3", 22 | "babel-loader": "^10.0.0", 23 | "css-loader": "^7.1.2", 24 | "html-webpack-plugin": "^5.6.3", 25 | "run-script-os": "^1.1.6", 26 | "style-loader": "^4.0.0", 27 | "webpack": "^5.98.0", 28 | "webpack-cli": "^6.0.1", 29 | "webpack-dev-server": "^5.2.0" 30 | } 31 | } -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/src/components/App.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --react-blue: #61dafb; 3 | } 4 | 5 | .App { 6 | text-align: center; 7 | } 8 | 9 | .App-header { 10 | background-color: #282c34; 11 | min-height: 100vh; 12 | display: flex; 13 | flex-direction: column; 14 | align-items: center; 15 | justify-content: center; 16 | font-size: calc(10px + 2vmin); 17 | color: white; 18 | } 19 | 20 | .App-header h1 { 21 | color: var(--react-blue); 22 | } 23 | 24 | table { 25 | border: none; 26 | border-collapse: collapse; 27 | } 28 | 29 | tr:nth-child(even) { 30 | background-color: #22252c; 31 | } 32 | 33 | th { 34 | border-bottom: solid 0.2rem var(--react-blue); 35 | } 36 | 37 | th, 38 | td { 39 | padding: 1rem; 40 | } 41 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/AspireJavaScript.React/src/favicon.ico -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | React App 13 | 14 | 15 | 16 |
17 | 25 | 26 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.React/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { createRoot } from "react-dom/client"; 3 | import "./index.css"; 4 | import App from "./components/App"; 5 | 6 | const container = document.getElementById("root"); 7 | const root = createRoot(container); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | ignorePatterns: ['dist', '.eslintrc.cjs'], 10 | parser: '@typescript-eslint/parser', 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': [ 14 | 'warn', 15 | { allowConstantExport: true }, 16 | ], 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 as build 2 | 3 | WORKDIR /app 4 | 5 | COPY package.json package.json 6 | COPY package-lock.json package-lock.json 7 | 8 | RUN npm install 9 | 10 | COPY . . 11 | 12 | RUN npm run build 13 | 14 | FROM nginx:alpine 15 | 16 | COPY --from=build /app/default.conf.template /etc/nginx/templates/default.conf.template 17 | COPY --from=build /app/dist /usr/share/nginx/html 18 | 19 | # Expose the default nginx port 20 | EXPOSE 80 21 | 22 | CMD ["nginx", "-g", "daemon off;"] 23 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/default.conf.template: -------------------------------------------------------------------------------- 1 | server { 2 | listen ${VITE_PORT}; 3 | listen [::]:${VITE_PORT}; 4 | server_name localhost; 5 | 6 | access_log /var/log/nginx/server.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | try_files $uri $uri/ /index.html; 11 | } 12 | 13 | location /api/ { 14 | proxy_pass ${services__weatherapi__https__0}; 15 | proxy_http_version 1.1; 16 | proxy_ssl_server_name on; 17 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 18 | rewrite ^/api(/.*)$ $1 break; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Weather 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aspirejavascript-vite", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "start": "vite", 9 | "build": "tsc -b && vite build", 10 | "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", 11 | "preview": "vite preview" 12 | }, 13 | "dependencies": { 14 | "react": "^19.0.0", 15 | "react-dom": "^19.0.0" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^22.12.0", 19 | "@types/react": "^19.0.8", 20 | "@types/react-dom": "^19.0.3", 21 | "@typescript-eslint/eslint-plugin": "^8.22.0", 22 | "@typescript-eslint/parser": "^8.22.0", 23 | "@vitejs/plugin-react": "^4.3.4", 24 | "eslint": "^9.19.0", 25 | "eslint-plugin-react-hooks": "^5.1.0", 26 | "eslint-plugin-react-refresh": "^0.4.18", 27 | "typescript": "~5.7.3", 28 | "vite": "^6.2.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/src/App.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --react-blue: #61dafb; 3 | } 4 | 5 | .App { 6 | text-align: center; 7 | width: 100vw; 8 | height: 100vh; 9 | } 10 | 11 | .App-header { 12 | background-color: #282c34; 13 | min-height: 100vh; 14 | display: flex; 15 | flex-direction: column; 16 | align-items: center; 17 | justify-content: center; 18 | font-size: calc(10px + 2vmin); 19 | color: white; 20 | } 21 | 22 | .App-header h1 { 23 | color: var(--react-blue); 24 | } 25 | 26 | table { 27 | border: none; 28 | border-collapse: collapse; 29 | } 30 | 31 | tr:nth-child(even) { 32 | background-color: #22252c; 33 | } 34 | 35 | th { 36 | border-bottom: solid 0.2rem var(--react-blue); 37 | } 38 | 39 | th, 40 | td { 41 | padding: 1rem; 42 | } -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.tsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/src/models/Forecast.ts: -------------------------------------------------------------------------------- 1 | export interface Forecast { 2 | date: string; 3 | temperatureC: number; 4 | temperatureF: number; 5 | summary: string; 6 | } 7 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | "target": "ES2020", 6 | "useDefineForClassFields": true, 7 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 8 | "module": "ESNext", 9 | "skipLibCheck": true, 10 | 11 | /* Bundler mode */ 12 | "moduleResolution": "bundler", 13 | "allowImportingTsExtensions": true, 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "moduleDetection": "force", 17 | "noEmit": true, 18 | "jsx": "react-jsx", 19 | 20 | /* Linting */ 21 | "strict": true, 22 | "noUnusedLocals": true, 23 | "noUnusedParameters": true, 24 | "noFallthroughCasesInSwitch": true 25 | }, 26 | "include": ["src"] 27 | } 28 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.app.json" 6 | }, 7 | { 8 | "path": "./tsconfig.node.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 5 | "skipLibCheck": true, 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "noEmit": true 11 | }, 12 | "include": ["vite.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vite/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, loadEnv } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig(({ mode }) => { 6 | const env = loadEnv(mode, process.cwd(), ''); 7 | 8 | return { 9 | plugins: [react()], 10 | server: { 11 | port: parseInt(env.VITE_PORT), 12 | proxy: { 13 | '/api': { 14 | target: process.env.services__weatherapi__https__0 || 15 | process.env.services__weatherapi__http__0, 16 | changeOrigin: true, 17 | rewrite: (path) => path.replace(/^\/api/, ''), 18 | secure: false, 19 | } 20 | } 21 | }, 22 | build: { 23 | outDir: 'dist', 24 | rollupOptions: { 25 | input: './index.html' 26 | } 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | require('@rushstack/eslint-patch/modern-module-resolution') 3 | 4 | module.exports = { 5 | root: true, 6 | 'extends': [ 7 | 'plugin:vue/vue3-essential', 8 | 'eslint:recommended', 9 | '@vue/eslint-config-typescript', 10 | '@vue/eslint-config-prettier/skip-formatting' 11 | ], 12 | parserOptions: { 13 | ecmaVersion: 'latest' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | 30 | *.tsbuildinfo 31 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/prettierrc", 3 | "semi": false, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "printWidth": 100, 7 | "trailingComma": "none" 8 | } -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "Vue.volar", 4 | "Vue.vscode-typescript-vue-plugin", 5 | "dbaeumer.vscode-eslint", 6 | "esbenp.prettier-vscode" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 as build 2 | 3 | WORKDIR /app 4 | 5 | COPY package.json package.json 6 | COPY package-lock.json package-lock.json 7 | 8 | RUN npm install 9 | 10 | COPY . . 11 | 12 | RUN npm run build 13 | 14 | FROM nginx:alpine 15 | 16 | COPY --from=build /app/default.conf.template /etc/nginx/templates/default.conf.template 17 | COPY --from=build /app/dist /usr/share/nginx/html 18 | 19 | # Expose the default nginx port 20 | EXPOSE 80 21 | 22 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/default.conf.template: -------------------------------------------------------------------------------- 1 | server { 2 | listen ${PORT}; 3 | listen [::]:${PORT}; 4 | server_name localhost; 5 | 6 | access_log /var/log/nginx/server.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | try_files $uri $uri/ /index.html; 11 | } 12 | 13 | location /api/ { 14 | proxy_pass ${services__weatherapi__https__0}; 15 | proxy_http_version 1.1; 16 | proxy_ssl_server_name on; 17 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 18 | rewrite ^/api(/.*)$ $1 break; 19 | } 20 | } -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/AspireJavaScript.Vue/public/favicon.ico -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | 20 | 48 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/assets/main.css: -------------------------------------------------------------------------------- 1 | @import './base.css'; 2 | 3 | #app { 4 | max-width: 1280px; 5 | margin: 0 auto; 6 | padding: 2rem; 7 | font-weight: normal; 8 | } 9 | 10 | a, 11 | .green { 12 | text-decoration: none; 13 | color: hsla(160, 100%, 37%, 1); 14 | transition: 0.4s; 15 | padding: 3px; 16 | } 17 | 18 | @media (hover: hover) { 19 | a:hover { 20 | background-color: hsla(160, 100%, 37%, 0.2); 21 | } 22 | } 23 | 24 | @media (min-width: 1024px) { 25 | body { 26 | display: flex; 27 | place-items: center; 28 | } 29 | 30 | #app { 31 | display: grid; 32 | grid-template-columns: 1fr 1fr; 33 | padding: 0 2rem; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 42 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/components/icons/IconCommunity.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/components/icons/IconSupport.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/components/icons/IconTooling.vue: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/src/main.ts: -------------------------------------------------------------------------------- 1 | import './assets/main.css' 2 | 3 | import { createApp } from 'vue' 4 | import App from './App.vue' 5 | 6 | createApp(App).mount('#app') 7 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["src/**/*", "src/**/*.vue"], 4 | "exclude": ["src/**/__tests__/*"], 5 | "compilerOptions": { 6 | "composite": true, 7 | "noEmit": true, 8 | "baseUrl": ".", 9 | "paths": { 10 | "@/*": ["./src/*"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.node.json" 6 | }, 7 | { 8 | "path": "./tsconfig.app.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node20/tsconfig.json", 3 | "include": [ 4 | "vite.config.*", 5 | "vitest.config.*", 6 | "cypress.config.*", 7 | "nightwatch.conf.*", 8 | "playwright.config.*" 9 | ], 10 | "compilerOptions": { 11 | "composite": true, 12 | "noEmit": true, 13 | "module": "ESNext", 14 | "moduleResolution": "Bundler", 15 | "types": ["node"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/AspireJavaScript.Vue/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from 'node:url' 2 | 3 | import { defineConfig } from 'vite' 4 | import vue from '@vitejs/plugin-vue' 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | plugins: [ 9 | vue(), 10 | ], 11 | resolve: { 12 | alias: { 13 | '@': fileURLToPath(new URL('./src', import.meta.url)) 14 | } 15 | }, 16 | server: { 17 | host: true, 18 | port: parseInt(process.env.PORT ?? "5173"), 19 | proxy: { 20 | '/api': { 21 | target: process.env.services__weatherapi__https__0 || process.env.services__weatherapi__http__0, 22 | changeOrigin: true, 23 | rewrite: path => path.replace(/^\/api/, ''), 24 | secure: false 25 | } 26 | } 27 | } 28 | }) 29 | -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/images/angular-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/images/angular-app.png -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/images/aspire-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/images/aspire-dashboard.png -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/images/react-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/images/react-app.png -------------------------------------------------------------------------------- /samples/AspireWithJavaScript/images/vue-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/AspireWithJavaScript/images/vue-app.png -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | 3 | var builder = DistributedApplication.CreateBuilder(args); 4 | 5 | var cache = builder.AddRedis("cache"); 6 | 7 | var weatherapi = builder.AddProject("weatherapi"); 8 | 9 | var frontend = builder.AddNpmApp("frontend", "../NodeFrontend", "watch") 10 | .WithReference(weatherapi) 11 | .WaitFor(weatherapi) 12 | .WithReference(cache) 13 | .WaitFor(cache) 14 | .WithHttpEndpoint(env: "PORT") 15 | .WithExternalHttpEndpoints() 16 | .PublishAsDockerFile(); 17 | 18 | var launchProfile = builder.Configuration["DOTNET_LAUNCH_PROFILE"]; 19 | 20 | if (builder.Environment.IsDevelopment() && launchProfile == "https") 21 | { 22 | frontend.RunWithHttpsDevCertificate("HTTPS_CERT_FILE", "HTTPS_CERT_KEY_FILE"); 23 | } 24 | 25 | builder.Build().Run(); 26 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AppHost/AspireWithNode.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AspNetCoreApi/AppHost.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | builder.AddServiceDefaults(); 4 | 5 | // Add services to the container. 6 | 7 | var app = builder.Build(); 8 | 9 | app.MapDefaultEndpoints(); 10 | 11 | // Configure the HTTP request pipeline. 12 | 13 | app.UseHttpsRedirection(); 14 | 15 | var summaries = new[] 16 | { 17 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 18 | }; 19 | 20 | app.MapGet("/weatherforecast", () => 21 | { 22 | var forecast = Enumerable.Range(1, 5).Select(index => 23 | new WeatherForecast 24 | ( 25 | DateOnly.FromDateTime(DateTime.Now.AddDays(index)), 26 | Random.Shared.Next(-20, 55), 27 | summaries[Random.Shared.Next(summaries.Length)] 28 | )) 29 | .ToArray(); 30 | return forecast; 31 | }); 32 | 33 | app.Run(); 34 | 35 | record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) 36 | { 37 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 38 | } 39 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AspNetCoreApi/AspireWithNode.AspNetCoreApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AspNetCoreApi/AspireWithNode.AspNetCoreApi.http: -------------------------------------------------------------------------------- 1 | @AspireWithNode.AspNetCoreApi_HostAddress = http://localhost:5114 2 | 3 | GET {{AspireWithNode.AspNetCoreApi_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AspNetCoreApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:8555", 8 | "sslPort": 44357 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "weatherforecast", 17 | "applicationUrl": "http://localhost:5114", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "weatherforecast", 27 | "applicationUrl": "https://localhost:7075;http://localhost:5114", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AspNetCoreApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithNode/AspireWithNode.AspNetCoreApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithNode/NodeFrontend/.npmrc: -------------------------------------------------------------------------------- 1 | # .npmrc 2 | engine-strict=true -------------------------------------------------------------------------------- /samples/AspireWithNode/NodeFrontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 2 | 3 | WORKDIR /app 4 | 5 | COPY package.json package.json 6 | COPY package-lock.json package-lock.json 7 | 8 | RUN npm install 9 | 10 | COPY . . 11 | 12 | CMD [ "node", "app.js" ] -------------------------------------------------------------------------------- /samples/AspireWithNode/NodeFrontend/views/index.pug: -------------------------------------------------------------------------------- 1 | //- Render an html page containing a table of weather forecasts 2 | html 3 | head(title=Weather Forecasts) 4 | body 5 | h1 Weather Forecasts 6 | table 7 | thead 8 | tr 9 | th Date 10 | th Temperature (C) 11 | th Summary 12 | tbody 13 | each forecast in forecasts 14 | tr 15 | td=forecast.date 16 | td=forecast.temperatureC 17 | td=forecast.summary 18 | -------------------------------------------------------------------------------- /samples/AspireWithPython/AspireWithPython.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | 3 | var builder = DistributedApplication.CreateBuilder(args); 4 | 5 | #pragma warning disable ASPIREHOSTINGPYTHON001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. 6 | var pythonapp = builder.AddPythonApp("instrumented-python-app", "../InstrumentedPythonProject", "app.py") 7 | .WithHttpEndpoint(env: "PORT") 8 | .WithExternalHttpEndpoints(); 9 | #pragma warning restore ASPIREHOSTINGPYTHON001 10 | 11 | if (builder.ExecutionContext.IsRunMode && builder.Environment.IsDevelopment()) 12 | { 13 | pythonapp.WithEnvironment("DEBUG", "True"); 14 | } 15 | 16 | builder.Build().Run(); 17 | -------------------------------------------------------------------------------- /samples/AspireWithPython/AspireWithPython.AppHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:15261", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development", 11 | "DOTNET_ENVIRONMENT": "Development", 12 | "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19290", 13 | "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20092", 14 | "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/AspireWithPython/AspireWithPython.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/AspireWithPython/AspireWithPython.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/AspireWithPython/AspireWithPython.ServiceDefaults/AspireWithPython.ServiceDefaults.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/AspireWithPython/InstrumentedPythonProject/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12.5-slim AS base 2 | 3 | # Set the working directory, the app files could be bind-mounted here 4 | WORKDIR /app 5 | 6 | # Copy the requirements file 7 | COPY requirements.txt . 8 | 9 | # Install dependencies 10 | RUN pip install --no-cache-dir -r requirements.txt 11 | 12 | # Ensure the server is accessible from outside the container 13 | ENV HOST=0.0.0.0 14 | 15 | # Set the entry point to run the application 16 | ENTRYPOINT ["opentelemetry-instrument", \ 17 | "--logs_exporter", "otlp", \ 18 | "--traces_exporter", "otlp", \ 19 | "--metrics_exporter", "otlp", \ 20 | "gunicorn", "--config", "gunicorn_config.py", "app:app"] 21 | 22 | CMD [] 23 | 24 | FROM base AS publish 25 | 26 | COPY . . -------------------------------------------------------------------------------- /samples/AspireWithPython/InstrumentedPythonProject/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | import logging 3 | import flask 4 | from opentelemetry import trace 5 | from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter 6 | from opentelemetry.sdk.trace import TracerProvider 7 | from opentelemetry.sdk.trace.export import BatchSpanProcessor 8 | from opentelemetry.instrumentation.flask import FlaskInstrumentor 9 | 10 | app = flask.Flask(__name__) 11 | 12 | trace.set_tracer_provider(TracerProvider()) 13 | otlpExporter = OTLPSpanExporter() 14 | processor = BatchSpanProcessor(otlpExporter) 15 | trace.get_tracer_provider().add_span_processor(processor) 16 | 17 | FlaskInstrumentor().instrument_app(app) 18 | 19 | logging.basicConfig(level=logging.INFO) 20 | logger = logging.getLogger(__name__) 21 | 22 | @app.route('/', methods=['GET']) 23 | def hello_world(): 24 | logger.info("request received!") 25 | return 'Hello, World!' 26 | 27 | if __name__ == '__main__': 28 | port = int(os.environ.get('PORT', 8111)) 29 | debug = bool(os.environ.get('DEBUG', False)) 30 | host = os.environ.get('HOST', '127.0.0.1') 31 | app.run(port=port, debug=debug, host=host) 32 | -------------------------------------------------------------------------------- /samples/AspireWithPython/InstrumentedPythonProject/gunicorn_config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | workers = int(os.environ.get('GUNICORN_PROCESSES', '1')) 4 | threads = int(os.environ.get('GUNICORN_THREADS', '2')) 5 | timeout = int(os.environ.get('GUNICORN_TIMEOUT', '120')) 6 | host = os.environ.get('HOST', '127.0.0.1') 7 | port = os.environ.get('PORT', '8000') 8 | bind = f'{host}:{port}' 9 | 10 | forwarded_allow_ips = '*' 11 | 12 | secure_scheme_headers = { 'X-Forwarded-Proto': 'https' } -------------------------------------------------------------------------------- /samples/AspireWithPython/InstrumentedPythonProject/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==3.0.3 2 | opentelemetry-distro 3 | opentelemetry-exporter-otlp-proto-grpc 4 | opentelemetry-instrumentation-flask 5 | gunicorn -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.ApiService/ClientAppsIntegration.ApiService.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.ApiService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "launchUrl": "weatherforecast", 9 | "applicationUrl": "http://localhost:5303", 10 | "environmentVariables": { 11 | "ASPNETCORE_ENVIRONMENT": "Development" 12 | } 13 | }, 14 | "https": { 15 | "commandName": "Project", 16 | "dotnetRunMessages": true, 17 | "launchBrowser": true, 18 | "launchUrl": "weatherforecast", 19 | "applicationUrl": "https://localhost:7303;http://localhost:5303", 20 | "environmentVariables": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.ApiService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.ApiService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.AppDefaults/ClientAppsIntegration.AppDefaults.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var apiService = builder.AddProject("apiservice"); 4 | 5 | if (OperatingSystem.IsWindows()) 6 | { 7 | builder.AddProject("winformsclient") 8 | .WithReference(apiService) 9 | .WaitFor(apiService) 10 | .WithExplicitStart() 11 | .ExcludeFromManifest(); 12 | 13 | builder.AddProject("wpfclient") 14 | .WithReference(apiService) 15 | .WaitFor(apiService) 16 | .WithExplicitStart() 17 | .ExcludeFromManifest(); 18 | } 19 | 20 | builder.Build().Run(); 21 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.AppHost/ClientAppsIntegration.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Configuration; 2 | using System.Data; 3 | using System.Windows; 4 | 5 | namespace ClientAppsIntegration.WPF; 6 | /// 7 | /// Interaction logic for App.xaml 8 | /// 9 | public partial class App : Application 10 | { 11 | } 12 | 13 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/AppHost.cs: -------------------------------------------------------------------------------- 1 | namespace ClientAppsIntegration.WPF; 2 | 3 | internal static class Program 4 | { 5 | [STAThread] 6 | public static void Main() 7 | { 8 | var builder = Host.CreateApplicationBuilder(); 9 | 10 | builder.AddAppDefaults(); 11 | 12 | builder.Services.AddHttpClient(client => client.BaseAddress = new("https+http://apiservice")); 13 | builder.Services.AddSingleton(); 14 | builder.Services.AddSingleton(); 15 | 16 | var appHost = builder.Build(); 17 | var app = appHost.Services.GetRequiredService(); 18 | var mainWindow = appHost.Services.GetRequiredService(); 19 | 20 | appHost.Start(); 21 | app.Run(mainWindow); 22 | 23 | appHost.StopAsync().GetAwaiter().GetResult(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ClientAppsIntegration.WPF": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "DOTNET_ENVIRONMENT": "Development" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/WeatherApiClient.cs: -------------------------------------------------------------------------------- 1 | namespace ClientAppsIntegration.WPF; 2 | 3 | public class WeatherApiClient(HttpClient httpClient) 4 | { 5 | public async Task GetWeatherAsync(CancellationToken cancellationToken = default) 6 | { 7 | return await httpClient.GetFromJsonAsync("/weatherforecast", cancellationToken) ?? []; 8 | } 9 | } 10 | 11 | public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) 12 | { 13 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 14 | } 15 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "Services": { 8 | "apiservice": [ 9 | "https://apiservice.myapp.mycompany.com:443" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WPF/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/AppHost.cs: -------------------------------------------------------------------------------- 1 | namespace ClientAppsIntegration.WinForms; 2 | 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | var builder = Host.CreateApplicationBuilder(); 12 | 13 | builder.AddAppDefaults(); 14 | 15 | builder.Services.AddHttpClient(client => client.BaseAddress = new("https+http://apiservice")); 16 | 17 | var app = builder.Build(); 18 | Services = app.Services; 19 | app.Start(); 20 | 21 | // To customize application configuration such as set high DPI settings or default font, 22 | // see https://aka.ms/applicationconfiguration. 23 | ApplicationConfiguration.Initialize(); 24 | Application.Run(ActivatorUtilities.CreateInstance(app.Services)); 25 | 26 | app.StopAsync().GetAwaiter().GetResult(); 27 | } 28 | 29 | public static IServiceProvider Services { get; private set; } = default!; 30 | } 31 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ClientAppsIntegration.WinForms": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "DOTNET_ENVIRONMENT": "Development" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/WeatherApiClient.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Json; 2 | 3 | namespace ClientAppsIntegration.WinForms; 4 | 5 | public class WeatherApiClient(HttpClient httpClient) 6 | { 7 | public async Task GetWeatherAsync(CancellationToken cancellationToken = default) 8 | { 9 | return await httpClient.GetFromJsonAsync("/weatherforecast", cancellationToken) ?? []; 10 | } 11 | } 12 | 13 | public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) 14 | { 15 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 16 | } 17 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "Services": { 8 | "apiservice": [ 9 | "https://apiservice.myapp.mycompany.com:443" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/ClientAppsIntegration/images/client-apps-dashboard-winforms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/ClientAppsIntegration/images/client-apps-dashboard-winforms.png -------------------------------------------------------------------------------- /samples/ContainerBuild/ContainerBuild.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | 3 | var builder = DistributedApplication.CreateBuilder(args); 4 | 5 | var goVersion = builder.AddParameter("goversion", "1.24.2", publishValueAsDefault: true); 6 | 7 | var ginapp = builder.AddDockerfile("ginapp", "../ginapp") 8 | .WithBuildArg("GO_VERSION", goVersion) 9 | .WithHttpEndpoint(targetPort: 5555, env: "PORT") 10 | .WithExternalHttpEndpoints(); 11 | 12 | if (builder.ExecutionContext.IsPublishMode || builder.Environment.IsProduction()) 13 | { 14 | ginapp 15 | .WithEnvironment("GIN_MODE", "release") 16 | // Trust all proxies when running behind a reverse proxy. If deploying to an environment 17 | // without a reverse proxy that ensures X-Forwarded-* headers are not forwarded from clients, 18 | // this should be removed. 19 | .WithEnvironment("TRUSTED_PROXIES", "all"); 20 | } 21 | 22 | builder.Build().Run(); 23 | -------------------------------------------------------------------------------- /samples/ContainerBuild/ContainerBuild.AppHost/ContainerBuild.AppHost.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 7f1af01c-67f3-44ee-af56-b1e02e4bfcbd 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/ContainerBuild/ContainerBuild.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parameters": { 3 | "goversion": "1.24.2" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft.AspNetCore": "Warning" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/ContainerBuild/ContainerBuild.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/ContainerBuild/ginapp/Dockerfile: -------------------------------------------------------------------------------- 1 | # Stage 1: Build the Go program 2 | ARG GO_VERSION=1.24.2 3 | FROM golang:${GO_VERSION} AS builder 4 | WORKDIR /app 5 | COPY . . 6 | RUN go mod tidy 7 | RUN go build . 8 | 9 | # Stage 2: Run the Go program 10 | FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 11 | WORKDIR /app 12 | COPY --from=builder /app/ginapp . 13 | CMD ["./ginapp"] 14 | -------------------------------------------------------------------------------- /samples/ContainerBuild/images/aspire-dashboard-container-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/ContainerBuild/images/aspire-dashboard-container-build.png -------------------------------------------------------------------------------- /samples/CustomResources/.aspire/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "appHostPath": "../CustomResources.AppHost/CustomResources.AppHost.csproj" 3 | } -------------------------------------------------------------------------------- /samples/CustomResources/CustomResources.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | using CustomResources.AppHost; 2 | 3 | var builder = DistributedApplication.CreateBuilder(args); 4 | 5 | builder.AddTalkingClock("talking-clock"); 6 | 7 | builder.AddTestResource("test"); 8 | 9 | builder.Build().Run(); 10 | -------------------------------------------------------------------------------- /samples/CustomResources/CustomResources.AppHost/CustomResources.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 00d08ee4-b2e0-4d12-827c-d131fda1c6f6 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/CustomResources/CustomResources.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/CustomResources/CustomResources.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.ApiService/AppHost.cs: -------------------------------------------------------------------------------- 1 | using DatabaseContainers.ApiService; 2 | 3 | var builder = WebApplication.CreateBuilder(args); 4 | 5 | // Add service defaults & Aspire components. 6 | builder.AddServiceDefaults(); 7 | 8 | builder.AddNpgsqlDataSource("Todos"); 9 | builder.AddMySqlDataSource("Catalog"); 10 | builder.AddSqlServerClient("AddressBook"); 11 | 12 | // Add services to the container. 13 | builder.Services.AddProblemDetails(); 14 | builder.Services.AddEndpointsApiExplorer(); 15 | builder.Services.AddSwaggerGen(); 16 | 17 | var app = builder.Build(); 18 | 19 | // Configure the HTTP request pipeline. 20 | app.UseExceptionHandler(); 21 | 22 | app.UseSwagger(); 23 | if (app.Environment.IsDevelopment()) 24 | { 25 | app.UseSwaggerUI(); 26 | } 27 | 28 | app.MapTodosApi(); 29 | app.MapCatalogApi(); 30 | app.MapAddressBookApi(); 31 | 32 | app.MapDefaultEndpoints(); 33 | 34 | app.Run(); 35 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.ApiService/DatabaseContainers.ApiService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.ApiService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "launchUrl": "swagger", 9 | "applicationUrl": "http://localhost:5468", 10 | "environmentVariables": { 11 | "ASPNETCORE_ENVIRONMENT": "Development" 12 | } 13 | }, 14 | "https": { 15 | "commandName": "Project", 16 | "dotnetRunMessages": true, 17 | "launchBrowser": true, 18 | "launchUrl": "swagger", 19 | "applicationUrl": "https://localhost:7408;http://localhost:5468", 20 | "environmentVariables": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.ApiService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.ApiService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.ApiService/data/postgres/init.sql: -------------------------------------------------------------------------------- 1 | -- Postgres init script 2 | 3 | -- Create the Todos table 4 | CREATE TABLE IF NOT EXISTS Todos 5 | ( 6 | Id SERIAL PRIMARY KEY, 7 | Title text UNIQUE NOT NULL, 8 | IsComplete boolean NOT NULL DEFAULT false 9 | ); 10 | 11 | -- Insert some sample data into the Todos table 12 | INSERT INTO Todos (Title, IsComplete) 13 | VALUES 14 | ('Give the dog a bath', false), 15 | ('Wash the dishes', false), 16 | ('Do the groceries', false) 17 | ON CONFLICT DO NOTHING; -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/DatabaseContainers.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/DatabaseContainers/images/db-containers-apiservice-swagger-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/DatabaseContainers/images/db-containers-apiservice-swagger-ui.png -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiModel/DatabaseMigrations.ApiModel.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | $(NoWarn);IDE0161;IDE0005 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiModel/MyDb1Context.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | public class MyDb1Context(DbContextOptions options) : DbContext(options) 7 | { 8 | public DbSet Entries { get; set; } 9 | } 10 | 11 | public class Entry 12 | { 13 | public Guid Id { get; set; } = Guid.NewGuid(); 14 | } 15 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiService/AppHost.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | var builder = WebApplication.CreateBuilder(args); 7 | 8 | builder.AddServiceDefaults(); 9 | 10 | builder.AddSqlServerDbContext("db1"); 11 | 12 | var app = builder.Build(); 13 | 14 | app.MapGet("/", async (MyDb1Context context) => 15 | { 16 | var entry = new Entry(); 17 | await context.Entries.AddAsync(entry); 18 | await context.SaveChangesAsync(); 19 | 20 | var entries = await context.Entries.ToListAsync(); 21 | 22 | return new 23 | { 24 | totalEntries = entries.Count, 25 | entries 26 | }; 27 | }); 28 | 29 | app.MapDefaultEndpoints(); 30 | 31 | app.Run(); 32 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiService/DatabaseMigrations.ApiService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5180", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7180;http://localhost:5180", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.ApiService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | var builder = DistributedApplication.CreateBuilder(args); 5 | 6 | var sqlserver = builder.AddSqlServer("sqlserver") 7 | .WithLifetime(ContainerLifetime.Persistent); 8 | 9 | var db1 = sqlserver.AddDatabase("db1"); 10 | 11 | var migrationService = builder.AddProject("migration") 12 | .WithReference(db1) 13 | .WaitFor(db1); 14 | 15 | builder.AddProject("api") 16 | .WithReference(db1) 17 | .WaitForCompletion(migrationService); 18 | 19 | builder.Build().Run(); 20 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.AppHost/DatabaseMigrations.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | b52c3688-9fbe-4033-ae05-bfed796c2775 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.MigrationService/AppHost.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using DatabaseMigrations.MigrationService; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | var builder = Host.CreateApplicationBuilder(args); 8 | 9 | builder.Services.AddHostedService(); 10 | 11 | builder.AddServiceDefaults(); 12 | 13 | builder.Services.AddDbContextPool(options => 14 | options.UseSqlServer(builder.Configuration.GetConnectionString("db1"), sqlOptions => 15 | sqlOptions.MigrationsAssembly("DatabaseMigrations.MigrationService") 16 | )); 17 | builder.EnrichSqlServerDbContext(); 18 | 19 | var app = builder.Build(); 20 | 21 | app.Run(); 22 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.MigrationService/DatabaseMigrations.MigrationService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | $(NoWarn);IDE0161;IDE0005 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/DatabaseMigrations/DatabaseMigrations.MigrationService/Migrations/20241028195151_Initial.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace DatabaseMigrations.MigrationService.Migrations 7 | { 8 | /// 9 | public partial class Initial : Migration 10 | { 11 | /// 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.CreateTable( 15 | name: "Entries", 16 | columns: table => new 17 | { 18 | Id = table.Column(type: "uniqueidentifier", nullable: false) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_Entries", x => x.Id); 23 | }); 24 | } 25 | 26 | /// 27 | protected override void Down(MigrationBuilder migrationBuilder) 28 | { 29 | migrationBuilder.DropTable( 30 | name: "Entries"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.ApiService/HealthChecksUI.ApiService.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.ApiService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "launchUrl": "weatherforecast", 9 | "applicationUrl": "http://localhost:5301", 10 | "environmentVariables": { 11 | "ASPNETCORE_ENVIRONMENT": "Development" 12 | } 13 | }, 14 | "https": { 15 | "commandName": "Project", 16 | "dotnetRunMessages": true, 17 | "launchBrowser": true, 18 | "launchUrl": "weatherforecast", 19 | "applicationUrl": "https://localhost:7202;http://localhost:5301", 20 | "environmentVariables": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.ApiService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.ApiService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var cache = builder.AddRedis("cache"); 4 | 5 | var apiService = builder.AddProject("apiservice"); 6 | 7 | var webFrontend = builder.AddProject("webfrontend") 8 | .WithReference(cache) 9 | .WaitFor(cache) 10 | .WithReference(apiService) 11 | .WaitFor(apiService) 12 | .WithExternalHttpEndpoints(); 13 | 14 | builder.AddHealthChecksUI("healthchecksui") 15 | .WithReference(apiService) 16 | .WithReference(webFrontend) 17 | // This will make the HealthChecksUI dashboard available from external networks when deployed. 18 | // In a production environment, you should consider adding authentication to the ingress layer 19 | // to restrict access to the dashboard. 20 | .WithExternalHttpEndpoints(); 21 | 22 | builder.Build().Run(); 23 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.AppHost/HealthChecksUI.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Components/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @rendermode InteractiveServer 3 | 4 | Counter 5 | 6 |

Counter

7 | 8 |

Current count: @currentCount

9 | 10 | 11 | 12 | @code { 13 | private int currentCount = 0; 14 | 15 | private void IncrementCount() 16 | { 17 | currentCount++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.AspNetCore.OutputCaching 9 | @using Microsoft.JSInterop 10 | @using HealthChecksUI.Web 11 | @using HealthChecksUI.Web.Components 12 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/HealthChecksUI.Web.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5102", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7062;http://localhost:5102", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/WeatherApiClient.cs: -------------------------------------------------------------------------------- 1 | namespace HealthChecksUI.Web; 2 | 3 | public class WeatherApiClient(HttpClient httpClient) 4 | { 5 | public async Task GetWeatherAsync(int maxItems = 10, CancellationToken cancellationToken = default) 6 | { 7 | var forecasts = new List(); 8 | 9 | await foreach (var forecast in httpClient.GetFromJsonAsAsyncEnumerable("/weatherforecast", cancellationToken)) 10 | { 11 | if (forecasts.Count >= maxItems) 12 | { 13 | break; 14 | } 15 | if (forecast is not null) 16 | { 17 | forecasts.Add(forecast); 18 | } 19 | } 20 | 21 | return [.. forecasts]; 22 | } 23 | } 24 | 25 | public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) 26 | { 27 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 28 | } 29 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/HealthChecksUI/HealthChecksUI.Web/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/HealthChecksUI/HealthChecksUI.Web/wwwroot/favicon.png -------------------------------------------------------------------------------- /samples/HealthChecksUI/images/healthchecksui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/HealthChecksUI/images/healthchecksui.png -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.AppHost/MetricsApp.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.AppHost/OpenTelemetryCollector/OpenTelemetryCollectorResource.cs: -------------------------------------------------------------------------------- 1 | namespace MetricsApp.AppHost.OpenTelemetryCollector; 2 | 3 | public class OpenTelemetryCollectorResource(string name) : ContainerResource(name) 4 | { 5 | internal const string OtlpGrpcEndpointName = "grpc"; 6 | internal const string OtlpHttpEndpointName = "http"; 7 | } 8 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.AppHost/OpenTelemetryCollector/OpenTelemetryCollectorServiceExtensions.cs: -------------------------------------------------------------------------------- 1 | using Aspire.Hosting.Lifecycle; 2 | 3 | namespace MetricsApp.AppHost.OpenTelemetryCollector; 4 | 5 | internal static class OpenTelemetryCollectorServiceExtensions 6 | { 7 | public static IDistributedApplicationBuilder AddOpenTelemetryCollectorInfrastructure(this IDistributedApplicationBuilder builder) 8 | { 9 | builder.Services.TryAddLifecycleHook(); 10 | 11 | return builder; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.AppHost/OpenTelemetryCollector/README.md: -------------------------------------------------------------------------------- 1 | # Aspire Hosting extension for the OpenTelemetry Collector 2 | 3 | Based on source from https://github.com/practical-otel/opentelemetry-aspire-collector by @martinjt. 4 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Not found 12 | 13 |

Sorry, there's nothing at this address.

14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/AppHost.cs: -------------------------------------------------------------------------------- 1 | using MetricsApp.Client; 2 | using MetricsApp.Client.Auth; 3 | using Microsoft.AspNetCore.Components.Authorization; 4 | using Microsoft.AspNetCore.Components.Web; 5 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 6 | 7 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 8 | builder.RootComponents.Add("#app"); 9 | builder.RootComponents.Add("head::after"); 10 | 11 | builder.Services.AddHttpClient("", c => c.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)) 12 | .AddHttpMessageHandler(sp => new IdentityHttpHandler(sp.GetRequiredService())) 13 | .AddStandardResilienceHandler(); 14 | builder.Services.AddAuthorizationCore(); 15 | builder.Services.AddCascadingAuthenticationState(); 16 | builder.Services.AddSingleton(); 17 | builder.Services.AddSingleton(s => s.GetRequiredService()); 18 | 19 | await builder.Build().RunAsync(); 20 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/Auth/IdentityHttpHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Headers; 2 | 3 | namespace MetricsApp.Client.Auth; 4 | 5 | public class IdentityHttpHandler(IdentityAuthenticationStateProvider authenticationStateProvider) : DelegatingHandler 6 | { 7 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 8 | { 9 | var userInfo = authenticationStateProvider.GetUserInfo(); 10 | if (userInfo != null) 11 | { 12 | request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", userInfo.AccessToken); 13 | } 14 | 15 | return base.SendAsync(request, cancellationToken); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/Auth/UserInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MetricsApp.Client.Auth; 2 | 3 | // Add properties to this class and update the server and client AuthenticationStateProviders 4 | // to expose more information about the authenticated user to the client. 5 | public class UserInfo 6 | { 7 | public required string UserId { get; init; } 8 | public required string AccessToken { get; init; } 9 | } 10 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 |
3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/MetricsApp.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | false 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @inject HttpClient Http 3 | 4 | Home 5 | 6 |

Hello, metrics!

7 | 8 | @if (_grafanaUrl != null) 9 | { 10 |

11 | View this app's Grafana dashboard at @_grafanaUrl. 12 |

13 | } 14 | 15 | @code { 16 | private static string? _grafanaUrl; 17 | 18 | protected override async Task OnInitializedAsync() 19 | { 20 | if (_grafanaUrl == null) 21 | { 22 | var config = await Http.GetFromJsonAsync("api/startup"); 23 | _grafanaUrl = config!.GrafanaUrl; 24 | } 25 | } 26 | 27 | private sealed class Config 28 | { 29 | public string? GrafanaUrl { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/Shared/RedirectToLogin.razor: -------------------------------------------------------------------------------- 1 | 

2 | Not authorized 3 |

4 | 5 |

6 | Login 7 |

-------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/Shared/StatusMessage.razor: -------------------------------------------------------------------------------- 1 | @if (!string.IsNullOrEmpty(Message)) 2 | { 3 | var statusMessageClass = Message.StartsWith("Error") ? "danger" : "success"; 4 | 7 | } 8 | 9 | @code { 10 | [Parameter] 11 | public string? Message { get; set; } 12 | } 13 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Authorization 4 | @using Microsoft.AspNetCore.Components.Authorization 5 | @using Microsoft.AspNetCore.Components.Forms 6 | @using Microsoft.AspNetCore.Components.Routing 7 | @using Microsoft.AspNetCore.Components.Web 8 | @using Microsoft.AspNetCore.Components.Web.Virtualization 9 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 10 | @using Microsoft.JSInterop 11 | @using MetricsApp.Client 12 | @using MetricsApp.Client.Auth 13 | @using MetricsApp.Client.Shared 14 | @using MetricsApp.Client.Layout 15 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/Metrics/MetricsApp.Client/wwwroot/favicon.png -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/Metrics/MetricsApp.Client/wwwroot/icon-192.png -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Metrics sample 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 |
22 |
23 | 24 |
25 | An unhandled error has occurred. 26 | Reload 27 | 🗙 28 |
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp/MetricsApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:30082", 7 | "sslPort": 44305 8 | } 9 | }, 10 | "profiles": { 11 | "http": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 16 | "applicationUrl": "http://localhost:5048", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 26 | "applicationUrl": "https://localhost:7079;http://localhost:5048", 27 | "environmentVariables": { 28 | "ASPNETCORE_ENVIRONMENT": "Development" 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/Metrics/MetricsApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/Metrics/grafana/config/grafana.ini: -------------------------------------------------------------------------------- 1 | [auth.anonymous] 2 | enabled = true 3 | 4 | # Organization name that should be used for unauthenticated users 5 | org_name = Main Org. 6 | 7 | # Role for unauthenticated users, other valid values are `Editor` and `Admin` 8 | org_role = Admin 9 | 10 | # Hide the Grafana version text from the footer and help tooltip for unauthenticated users (default: false) 11 | hide_version = true 12 | 13 | [dashboards] 14 | default_home_dashboard_path = /var/lib/grafana/dashboards/aspnetcore.json 15 | 16 | min_refresh_interval = 1s -------------------------------------------------------------------------------- /samples/Metrics/grafana/config/provisioning/dashboards/default.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | - name: Default 5 | folder: .NET 6 | type: file 7 | options: 8 | path: 9 | /var/lib/grafana/dashboards -------------------------------------------------------------------------------- /samples/Metrics/grafana/config/provisioning/datasources/default.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | datasources: 4 | - name: Prometheus 5 | type: prometheus 6 | access: proxy 7 | # Access mode - proxy (server in the UI) or direct (browser in the UI). 8 | url: $PROMETHEUS_ENDPOINT 9 | uid: PBFA97CFB590B2093 10 | -------------------------------------------------------------------------------- /samples/Metrics/images/dashboard-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/Metrics/images/dashboard-screenshot.png -------------------------------------------------------------------------------- /samples/Metrics/otelcollector/config.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | endpoint: 0.0.0.0:4317 6 | http: 7 | endpoint: 0.0.0.0:4318 8 | 9 | processors: 10 | batch: 11 | 12 | exporters: 13 | debug: 14 | verbosity: detailed 15 | otlp/aspire: 16 | endpoint: ${env:ASPIRE_ENDPOINT} 17 | headers: 18 | x-otlp-api-key: ${env:ASPIRE_API_KEY} 19 | tls: 20 | insecure: ${env:ASPIRE_INSECURE} 21 | insecure_skip_verify: true # Required in local development because cert is localhost and the endpoint is host.docker.internal 22 | otlphttp/prometheus: 23 | endpoint: ${env:PROMETHEUS_ENDPOINT} 24 | tls: 25 | insecure: true 26 | 27 | service: 28 | pipelines: 29 | traces: 30 | receivers: [otlp] 31 | processors: [batch] 32 | exporters: [otlp/aspire] 33 | logs: 34 | receivers: [otlp] 35 | processors: [batch] 36 | exporters: [otlp/aspire] 37 | metrics: 38 | receivers: [otlp] 39 | processors: [batch] 40 | exporters: 41 | - otlp/aspire 42 | - otlphttp/prometheus 43 | -------------------------------------------------------------------------------- /samples/Metrics/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | storage: 2 | tsdb: 3 | out_of_order_time_window: 30m 4 | 5 | otlp: 6 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var redis = builder.AddRedis("voting-redis"); 4 | 5 | var orleans = builder.AddOrleans("voting-cluster") 6 | .WithClustering(redis) 7 | .WithGrainStorage("votes", redis); 8 | 9 | builder.AddProject("voting-fe") 10 | .WithReference(orleans) 11 | .WaitFor(redis) 12 | .WithReplicas(3) 13 | .WithExternalHttpEndpoints(); 14 | 15 | builder.Build().Run(); 16 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.AppHost/OrleansVoting.AppHost.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/App.razor: -------------------------------------------------------------------------------- 1 | @using OrleansVoting.Data 2 | @using OrleansVoting.Service.Shared 3 | 4 | @inject PollService PollService 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Not found 13 | 14 |

Sorry, there's nothing at this address.

15 |
16 |
17 |
18 | @code 19 | { 20 | [Parameter] public string? ClientIP { get; set; } 21 | 22 | protected override Task OnInitializedAsync() 23 | { 24 | PollService.Initialize(ClientIP!); 25 | return base.OnInitializedAsync(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/AppHost.cs: -------------------------------------------------------------------------------- 1 | using OrleansVoting.Data; 2 | 3 | var builder = WebApplication.CreateBuilder(args); 4 | 5 | builder.AddServiceDefaults(); 6 | 7 | builder.AddKeyedRedisClient("voting-redis"); 8 | 9 | builder.UseOrleans(); 10 | 11 | // Add services to the container. 12 | builder.Services.AddRazorPages(); 13 | builder.Services.AddServerSideBlazor(); 14 | builder.Services.AddScoped(); 15 | builder.Services.AddScoped(); 16 | 17 | var app = builder.Build(); 18 | 19 | app.UseHttpsRedirection(); 20 | app.UseStaticFiles(); 21 | app.UseRouting(); 22 | 23 | app.MapBlazorHub(); 24 | app.MapFallbackToPage("/_Host"); 25 | app.MapDefaultEndpoints(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Microsoft.AspNetCore.Mvc; 3 | using VotingWeb.Models; 4 | 5 | namespace VotingWeb.Controllers; 6 | 7 | [Route("")] 8 | [Route("Home")] 9 | [Route("Home/Index")] 10 | public class HomeController : Controller 11 | { 12 | private readonly ILogger _logger; 13 | 14 | public HomeController(ILogger logger) 15 | { 16 | _logger = logger; 17 | } 18 | 19 | public ActionResult Index() 20 | { 21 | _logger.LogInformation("Returning Index page"); 22 | return View(); 23 | } 24 | 25 | [Route("Home/Error")] 26 | public ActionResult Error() 27 | { 28 | _logger.LogInformation("Returning Error page"); 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Grains/IPollGrain.cs: -------------------------------------------------------------------------------- 1 | namespace OrleansVoting; 2 | 3 | public interface IPollGrain : IGrainWithStringKey 4 | { 5 | Task CreatePoll(PollState initialState); 6 | Task GetCurrentResults(); 7 | Task AddVote(int optionId); 8 | Task StartWatching(IPollWatcher watcher); 9 | Task StopWatching(IPollWatcher watcher); 10 | } 11 | 12 | [GenerateSerializer] 13 | public class PollState 14 | { 15 | [Id(0)] public required string Question { get; init; } 16 | [Id(1)] public required List<(string Option, int Votes)> Options { get; init; } 17 | } 18 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Grains/IPollWatcher.cs: -------------------------------------------------------------------------------- 1 | namespace OrleansVoting; 2 | 3 | public interface IPollWatcher : IGrainObserver 4 | { 5 | void OnPollUpdated(PollState state); 6 | } 7 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Grains/IUserAgentGrain.cs: -------------------------------------------------------------------------------- 1 | namespace OrleansVoting; 2 | 3 | public interface IUserAgentGrain : IGrainWithStringKey 4 | { 5 | Task CreatePoll(PollState initialState); 6 | Task<(PollState Results, bool Voted)> GetPollResults(string pollId); 7 | Task AddVote(string pollId, int optionId); 8 | } 9 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Grains/IVoteGrain.cs: -------------------------------------------------------------------------------- 1 | using Orleans; 2 | 3 | namespace OrleansVoting; 4 | 5 | public interface IVoteGrain : IGrainWithIntegerKey 6 | { 7 | Task> Get(); 8 | Task AddVote(string option); 9 | Task RemoveVote(string option); 10 | } 11 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Helpers/ThrottlingException.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace OrleansVoting; 4 | 5 | [GenerateSerializer] 6 | [Alias("OrleansVoting.ThrottlingException")] 7 | public class ThrottlingException : Exception 8 | { 9 | public ThrottlingException(string message) : base(message) { } 10 | public ThrottlingException(string message, Exception innerException) : base(message, innerException) { } 11 | } 12 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace VotingWeb.Models; 2 | 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } = null!; 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/OrleansVoting.Service.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace OrleansVoting.Pages; 6 | 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | public void OnGet() 16 | { 17 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | @inject NavigationManager NavigationManager 4 | 5 | @code { 6 | protected override void OnAfterRender(bool firstRender) 7 | { 8 | NavigationManager.NavigateTo("/new"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace OrleansVoting.Pages 3 | @using OrleansVoting.Service 4 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 5 | @{ 6 | Layout = "_Layout"; 7 | var clientIp = HttpContext.Connection.RemoteIpAddress?.ToString(); 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5178", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7178;http://localhost:5178", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @using Orleans.Runtime 2 | @inherits LayoutComponentBase 3 | @inject ILocalSiloDetails LocalSiloDetails 4 | 5 | Grain Poll 6 | 7 |
8 | 11 | 12 |
13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 |

Server address @LocalSiloDetails.SiloAddress.ToString()

21 |
22 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/Startup.cs: -------------------------------------------------------------------------------- 1 | public class Startup 2 | { 3 | public void ConfigureServices(IServiceCollection services) => 4 | services.AddControllersWithViews(); 5 | 6 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) => 7 | app.UseStaticFiles() 8 | .UseRouting() 9 | .UseEndpoints( 10 | endpoints => endpoints.MapDefaultControllerRoute()); 11 | } 12 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using OrleansVoting 10 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/images/favicon.png -------------------------------------------------------------------------------- /samples/OrleansVoting/OrleansVoting.Service/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/OrleansVoting/OrleansVoting.Service/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /samples/StandaloneDashboard/ConsoleApp/ConsoleApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/StandaloneDashboard/ConsoleApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ConsoleApp": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "DOTNET_ENVIRONMENT": "Development", 7 | "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4317" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/StandaloneDashboard/ConsoleApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/StandaloneDashboard/ConsoleApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/StandaloneDashboard/images/aspire-dashboard-container-log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/StandaloneDashboard/images/aspire-dashboard-container-log.png -------------------------------------------------------------------------------- /samples/StandaloneDashboard/images/aspire-dashboard-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/StandaloneDashboard/images/aspire-dashboard-screenshot.png -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.AppHost/AppHost.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var sqlserver = builder.AddSqlServer("sqlserver") 4 | .WithDataVolume() 5 | .WithLifetime(ContainerLifetime.Persistent); 6 | 7 | var sqlDatabase = sqlserver.AddDatabase("sqldb"); 8 | 9 | var postgresServer = builder.AddPostgres("postgresserver") 10 | .WithDataVolume() 11 | .WithLifetime(ContainerLifetime.Persistent); 12 | 13 | var postgresDatabase = postgresServer.AddDatabase("postgres"); 14 | 15 | var blobs = builder.AddAzureStorage("Storage") 16 | // Use the Azurite storage emulator for local development 17 | .RunAsEmulator(emulator => emulator.WithDataVolume()) 18 | .AddBlobs("BlobConnection"); 19 | 20 | builder.AddProject("blazorweb") 21 | .WithReference(sqlDatabase) 22 | .WaitFor(sqlDatabase) 23 | .WithReference(postgresDatabase) 24 | .WaitFor(postgresDatabase) 25 | .WithReference(blobs) 26 | .WaitFor(blobs); 27 | 28 | builder.Build().Run(); 29 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.AppHost/VolumeMount.AppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Exe 7 | net8.0 8 | enable 9 | enable 10 | 969c2ebd-aca5-4e75-aac2-cffc93ee7e80 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/IdentityUserAccessor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using VolumeMount.BlazorWeb.Data; 3 | 4 | namespace VolumeMount.BlazorWeb.Components.Account; 5 | 6 | internal sealed class IdentityUserAccessor(UserManager userManager, IdentityRedirectManager redirectManager) 7 | { 8 | public async Task GetRequiredUserAsync(HttpContext context) 9 | { 10 | var user = await userManager.GetUserAsync(context.User); 11 | 12 | if (user is null) 13 | { 14 | redirectManager.RedirectToWithStatus("Account/InvalidUser", $"Error: Unable to load user with ID '{userManager.GetUserId(context.User)}'.", context); 15 | } 16 | 17 | return user; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/ForgotPasswordConfirmation.razor: -------------------------------------------------------------------------------- 1 | @page "/Account/ForgotPasswordConfirmation" 2 | 3 | Forgot password confirmation 4 | 5 |

Forgot password confirmation

6 |

7 | Please check your email to reset your password. 8 |

9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/InvalidPasswordReset.razor: -------------------------------------------------------------------------------- 1 | @page "/Account/InvalidPasswordReset" 2 | 3 | Invalid password reset 4 | 5 |

Invalid password reset

6 |

7 | The password reset link is invalid. 8 |

9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/InvalidUser.razor: -------------------------------------------------------------------------------- 1 | @page "/Account/InvalidUser" 2 | 3 | Invalid user 4 | 5 |

Invalid user

6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/Lockout.razor: -------------------------------------------------------------------------------- 1 | @page "/Account/Lockout" 2 | 3 | Locked out 4 | 5 |
6 |

Locked out

7 |

This account has been locked out, please try again later.

8 |
9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/Manage/_Imports.razor: -------------------------------------------------------------------------------- 1 | @layout ManageLayout 2 | @attribute [Microsoft.AspNetCore.Authorization.Authorize] 3 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/ResetPasswordConfirmation.razor: -------------------------------------------------------------------------------- 1 | @page "/Account/ResetPasswordConfirmation" 2 | Reset password confirmation 3 | 4 |

Reset password confirmation

5 |

6 | Your password has been reset. Please click here to log in. 7 |

8 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Pages/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using VolumeMount.BlazorWeb.Components.Account.Shared 2 | @layout AccountLayout 3 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Shared/AccountLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @layout VolumeMount.BlazorWeb.Components.Layout.MainLayout 3 | @inject NavigationManager NavigationManager 4 | 5 | @if (HttpContext is null) 6 | { 7 |

Loading...

8 | } 9 | else 10 | { 11 | @Body 12 | } 13 | 14 | @code { 15 | [CascadingParameter] 16 | private HttpContext? HttpContext { get; set; } 17 | 18 | protected override void OnParametersSet() 19 | { 20 | if (HttpContext is null) 21 | { 22 | // If this code runs, we're currently rendering in interactive mode, so there is no HttpContext. 23 | // The identity pages need to set cookies, so they require an HttpContext. To achieve this we 24 | // must transition back from interactive mode to a server-rendered page. 25 | NavigationManager.Refresh(forceReload: true); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Shared/ManageLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @layout AccountLayout 3 | 4 |

Manage your account

5 | 6 |
7 |

Change your account settings

8 |
9 |
10 |
11 | 12 |
13 |
14 | @Body 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Shared/RedirectToLogin.razor: -------------------------------------------------------------------------------- 1 | @inject NavigationManager NavigationManager 2 | 3 | @code { 4 | protected override void OnInitialized() 5 | { 6 | NavigationManager.NavigateTo($"Account/Login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Shared/ShowRecoveryCodes.razor: -------------------------------------------------------------------------------- 1 |  2 |

Recovery codes

3 | 11 |
12 |
13 | @foreach (var recoveryCode in RecoveryCodes) 14 | { 15 |
16 | @recoveryCode 17 |
18 | } 19 |
20 |
21 | 22 | @code { 23 | [Parameter] 24 | public string[] RecoveryCodes { get; set; } = []; 25 | 26 | [Parameter] 27 | public string? StatusMessage { get; set; } 28 | } 29 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Account/Shared/StatusMessage.razor: -------------------------------------------------------------------------------- 1 | @if (!string.IsNullOrEmpty(DisplayMessage)) 2 | { 3 | var statusMessageClass = DisplayMessage.StartsWith("Error") ? "danger" : "success"; 4 | 7 | } 8 | 9 | @code { 10 | private string? messageFromCookie; 11 | 12 | [Parameter] 13 | public string? Message { get; set; } 14 | 15 | [CascadingParameter] 16 | private HttpContext HttpContext { get; set; } = default!; 17 | 18 | private string? DisplayMessage => Message ?? messageFromCookie; 19 | 20 | protected override void OnInitialized() 21 | { 22 | messageFromCookie = HttpContext.Request.Cookies[IdentityRedirectManager.StatusCookieName]; 23 | 24 | if (messageFromCookie is not null) 25 | { 26 | HttpContext.Response.Cookies.Delete(IdentityRedirectManager.StatusCookieName); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Pages/Auth.razor: -------------------------------------------------------------------------------- 1 | @page "/auth" 2 | 3 | @using Microsoft.AspNetCore.Authorization 4 | 5 | @attribute [Authorize] 6 | 7 | Auth 8 | 9 |

You are authenticated

10 | 11 | 12 | Hello @context.User.Identity?.Name! 13 | 14 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @rendermode InteractiveServer 3 | 4 | Counter 5 | 6 |

Counter

7 | 8 |

Current count: @currentCount

9 | 10 | 11 | 12 | @code { 13 | private int currentCount = 0; 14 | 15 | private void IncrementCount() 16 | { 17 | currentCount++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/Routes.razor: -------------------------------------------------------------------------------- 1 | @using VolumeMount.BlazorWeb.Components.Account.Shared 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.AspNetCore.Components.Web.Virtualization 9 | @using Microsoft.JSInterop 10 | @using VolumeMount.BlazorWeb 11 | @using VolumeMount.BlazorWeb.Components 12 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace VolumeMount.BlazorWeb.Data; 5 | 6 | public class ApplicationDbContext(DbContextOptions options) : IdentityDbContext(options) 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Data/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace VolumeMount.BlazorWeb.Data; 4 | 5 | // Add profile data for application users by adding properties to the ApplicationUser class 6 | public class ApplicationUser : IdentityUser 7 | { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Data/PostgresDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace VolumeMount.BlazorWeb.Data; 4 | 5 | public class PostgresDbContext(DbContextOptions options) : DbContext(options) 6 | { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:4597", 8 | "sslPort": 44356 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5034", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7235;http://localhost:5034", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql", 5 | "connectionId": "ConnectionStrings:DefaultConnection" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql.local", 5 | "connectionId": "ConnectionStrings:DefaultConnection" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-VolumeMount.BlazorWeb-9d3e705c-96bc-40ba-a6e8-3862004ea1e2;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft.AspNetCore": "Information" 9 | } 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /samples/VolumeMount/VolumeMount.BlazorWeb/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/VolumeMount/VolumeMount.BlazorWeb/wwwroot/favicon.png -------------------------------------------------------------------------------- /samples/VolumeMount/images/volume-mount-frontend-account-registered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/VolumeMount/images/volume-mount-frontend-account-registered.png -------------------------------------------------------------------------------- /samples/VolumeMount/images/volume-mount-frontend-dbcontext-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/VolumeMount/images/volume-mount-frontend-dbcontext-error.png -------------------------------------------------------------------------------- /samples/VolumeMount/images/volume-mount-frontend-email-confirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/VolumeMount/images/volume-mount-frontend-email-confirmed.png -------------------------------------------------------------------------------- /samples/VolumeMount/images/volume-mount-frontend-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/VolumeMount/images/volume-mount-frontend-login.png -------------------------------------------------------------------------------- /samples/VolumeMount/images/volume-mount-frontend-register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/aspire-samples/bf62e3a8813fd916bcad455a6be4014a6b6f8984/samples/VolumeMount/images/volume-mount-frontend-register.png -------------------------------------------------------------------------------- /tests/SamplesIntegrationTests/Infrastructure/ResourceExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | namespace SamplesIntegrationTests.Infrastructure; 5 | 6 | internal static class ResourceExtensions 7 | { 8 | /// 9 | /// Gets the name of the based on the project file path. 10 | /// 11 | public static string GetName(this ProjectResource project) 12 | { 13 | var metadata = project.GetProjectMetadata(); 14 | return Path.GetFileNameWithoutExtension(metadata.ProjectPath); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/SamplesIntegrationTests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", 3 | "diagnosticMessages": true, 4 | "longRunningTestSeconds": 120, 5 | "stopOnFail": true, 6 | "showLiveOutput": true 7 | } --------------------------------------------------------------------------------