From f548bdc576bbf5220f7a6464fcb90a8a581e43a4 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sat, 27 Jan 2024 15:10:12 +1100 Subject: [PATCH 1/2] End to end SQL playground. --- playground/SqlServerEndToEnd/.gitignore | 1 + .../SqlServerEndToEnd.ApiService/Program.cs | 50 ++++++++++++++ .../Properties/launchSettings.json | 14 ++++ .../SqlServerEndToEnd.ApiService.csproj | 14 ++++ .../SqlServerEndToEnd.ApiService.http | 6 ++ .../appsettings.Development.json | 8 +++ .../appsettings.json | 9 +++ .../Directory.Build.props | 8 +++ .../Directory.Build.targets | 9 +++ .../SqlServerEndToEnd.AppHost/Program.cs | 18 +++++ .../Properties/launchSettings.json | 29 ++++++++ .../SqlServerEndToEnd.AppHost.csproj | 22 ++++++ .../appsettings.Development.json | 8 +++ .../appsettings.json | 9 +++ playground/SqlServerEndToEnd/azure.yaml | 8 +++ playground/SqlServerEndToEnd/next-steps.md | 69 +++++++++++++++++++ 16 files changed, 282 insertions(+) create mode 100644 playground/SqlServerEndToEnd/.gitignore create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Program.cs create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Properties/launchSettings.json create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.csproj create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.http create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.Development.json create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.json create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.props create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.targets create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Program.cs create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Properties/launchSettings.json create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/SqlServerEndToEnd.AppHost.csproj create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.Development.json create mode 100644 playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.json create mode 100644 playground/SqlServerEndToEnd/azure.yaml create mode 100644 playground/SqlServerEndToEnd/next-steps.md diff --git a/playground/SqlServerEndToEnd/.gitignore b/playground/SqlServerEndToEnd/.gitignore new file mode 100644 index 00000000000..8e84380248d --- /dev/null +++ b/playground/SqlServerEndToEnd/.gitignore @@ -0,0 +1 @@ +.azure diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Program.cs b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Program.cs new file mode 100644 index 00000000000..3d4e45a0d02 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Program.cs @@ -0,0 +1,50 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.EntityFrameworkCore; + +var builder = WebApplication.CreateBuilder(args); + +builder.AddServiceDefaults(); + +builder.AddSqlServerDbContext("db"); + +var app = builder.Build(); + +app.MapGet("/", async (MyDbContext context) => +{ + // You wouldn't normally do this on every call, + // but doing it here just to make this simple. + context.Database.EnsureCreated(); + + var entry = new Entry(); + await context.Entries.AddAsync(entry); + await context.SaveChangesAsync(); + + var entries = await context.Entries.ToListAsync(); + + return new + { + totalEntries = entries.Count, + entries = entries + }; +}); + +app.Run(); + +public class MyDbContext(DbContextOptions options) : DbContext(options) +{ + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.Entity().HasKey(e => e.Id); + } + + public DbSet Entries { get; set; } +} + +public class Entry +{ + public Guid Id { get; set; } = Guid.NewGuid(); +} diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Properties/launchSettings.json b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Properties/launchSettings.json new file mode 100644 index 00000000000..f7bf310e7ae --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/Properties/launchSettings.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5180", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.csproj b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.csproj new file mode 100644 index 00000000000..6caccbe4360 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.http b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.http new file mode 100644 index 00000000000..59fcd09ca55 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/SqlServerEndToEnd.ApiService.http @@ -0,0 +1,6 @@ +@CosmosEndToEnd.ApiService_HostAddress = http://localhost:5193 + +GET {{SqlServerEndToEnd.ApiService_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.Development.json b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.Development.json new file mode 100644 index 00000000000..0c208ae9181 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.json b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.json new file mode 100644 index 00000000000..10f68b8c8b4 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.ApiService/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.props b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.props new file mode 100644 index 00000000000..b9b39c05e81 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.targets b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.targets new file mode 100644 index 00000000000..b7ba77268f8 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Directory.Build.targets @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Program.cs b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Program.cs new file mode 100644 index 00000000000..e2dbe5f854c --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Program.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +var builder = DistributedApplication.CreateBuilder(args); + +var db = builder.AddSqlServer("sql").AddDatabase("db"); + +builder.AddProject("api") + .WithReference(db); + +// This project is only added in playground projects to support development/debugging +// of the dashboard. It is not required in end developer code. Comment out this code +// to test end developer dashboard launch experience. Refer to Directory.Build.props +// for the path to the dashboard binary (defaults to the Aspire.Dashboard bin output +// in the artifacts dir). +//builder.AddProject(KnownResourceNames.AspireDashboard); + +builder.Build().Run(); diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Properties/launchSettings.json b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Properties/launchSettings.json new file mode 100644 index 00000000000..16aca777b1e --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Properties/launchSettings.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:15888", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16175", + "DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true" // Display dashboard resource in console for local development + } + }, + "generate-manifest": { + "commandName": "Project", + "launchBrowser": true, + "dotnetRunMessages": true, + "commandLineArgs": "--publisher manifest --output-path aspire-manifest.json", + "applicationUrl": "http://localhost:15888", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16175" + } + } + } +} diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/SqlServerEndToEnd.AppHost.csproj b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/SqlServerEndToEnd.AppHost.csproj new file mode 100644 index 00000000000..ff809fd13bf --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/SqlServerEndToEnd.AppHost.csproj @@ -0,0 +1,22 @@ + + + + Exe + net8.0 + enable + enable + true + + + + + + + + + + + + + + diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.Development.json b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.Development.json new file mode 100644 index 00000000000..0c208ae9181 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.json b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.json new file mode 100644 index 00000000000..31c092aa450 --- /dev/null +++ b/playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.Dcp": "Warning" + } + } +} diff --git a/playground/SqlServerEndToEnd/azure.yaml b/playground/SqlServerEndToEnd/azure.yaml new file mode 100644 index 00000000000..1637c654f5c --- /dev/null +++ b/playground/SqlServerEndToEnd/azure.yaml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json + +name: SqlServerEndToEnd +services: + app: + language: dotnet + project: .\SqlServerEndToEnd.AppHost\SqlServerEndToEnd.AppHost.csproj + host: containerapp diff --git a/playground/SqlServerEndToEnd/next-steps.md b/playground/SqlServerEndToEnd/next-steps.md new file mode 100644 index 00000000000..a0803b523c5 --- /dev/null +++ b/playground/SqlServerEndToEnd/next-steps.md @@ -0,0 +1,69 @@ +# Next Steps after `azd init` + +## Table of Contents + +1. [Next Steps](#next-steps) +2. [What was added](#what-was-added) +3. [Billing](#billing) +4. [Troubleshooting](#troubleshooting) + +## Next Steps + +### Provision infrastructure and deploy application code + +Run `azd up` to provision your infrastructure and deploy to Azure in one step (or run `azd provision` then `azd deploy` to accomplish the tasks separately). Visit the service endpoints listed to see your application up-and-running! + +To troubleshoot any issues, see [troubleshooting](#troubleshooting). + +### Configure CI/CD pipeline + +1. Create a workflow pipeline file locally. The following starters are available: + - [Deploy with GitHub Actions](https://github.com/Azure-Samples/azd-starter-bicep/blob/main/.github/workflows/azure-dev.yml) + - [Deploy with Azure Pipelines](https://github.com/Azure-Samples/azd-starter-bicep/blob/main/.azdo/pipelines/azure-dev.yml) +2. Run `azd pipeline config -e ` to configure the deployment pipeline to connect securely to Azure. An environment name is specified here to configure the pipeline with a different environment for isolation purposes. Run `azd env list` and `azd env set` to reselect the default environment after this step. + +## What was added + +### Infrastructure configuration + +To describe the infrastructure and application and `azure.yaml` was added with the following directory structure: + +```yaml +- azure.yaml # azd project configuration +``` + +This file contains a single service, which references your project's App Host. When needed, `azd` generates the required infrastructure as code in memory and uses it. + +If you would like to see or modify the infrastructure that `azd` uses, run `azd infra synth` to persist it to disk. + +If you do this, some additional directories will be created: + +```yaml +- infra/ # Infrastructure as Code (bicep) files + - main.bicep # main deployment module + - resources.bicep # resources shared across your application's services +``` + +In addition, for each project resource referenced by your app host, a `containerApp.tmpl.yaml` file will be created in a directory named `manifests` next the project file. This file contains the infrastructure as code for running the project on Azure Container Apps. + +*Note*: Once you have synthesized your infrastructure to disk, changes made to your App Host will not be reflected in the infrastructure. You can re-generate the infrastructure by running `azd infra synth` again. It will prompt you before overwriting files. You can pass `--force` to force `azd infra synth` to overwrite the files without prompting. + +*Note*: `azd infra synth` is currently an alpha feature and must be explicitly enabled by running `azd config set alpha.infraSynth on`. You only need to do this once. + +## Billing + +Visit the *Cost Management + Billing* page in Azure Portal to track current spend. For more information about how you're billed, and how you can monitor the costs incurred in your Azure subscriptions, visit [billing overview](https://learn.microsoft.com/en-us/azure/developer/intro/azure-developer-billing). + +## Troubleshooting + +Q: I visited the service endpoint listed, and I'm seeing a blank or error page. + +A: Your service may have failed to start or misconfigured. To investigate further: + +1. Click on the resource group link shown to visit Azure Portal. +2. Navigate to the specific Azure Container App resource for the service. +3. Select *Monitoring -> Log stream* under the navigation pane. +4. Observe the log output to identify any errors. +5. If logs are written to disk, examine the local logs or debug the application by using the *Console* to connect to a shell within the running container. + +For additional information about setting up your `azd` project, visit our official [docs](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/make-azd-compatible?pivots=azd-convert). From 8f2d9a8c38a876a7664939d860910f826e65bd5f Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sat, 27 Jan 2024 15:11:51 +1100 Subject: [PATCH 2/2] Remove unnecessary files. --- Aspire.sln | 17 ++++++ playground/SqlServerEndToEnd/.gitignore | 1 - playground/SqlServerEndToEnd/azure.yaml | 8 --- playground/SqlServerEndToEnd/next-steps.md | 69 ---------------------- 4 files changed, 17 insertions(+), 78 deletions(-) delete mode 100644 playground/SqlServerEndToEnd/.gitignore delete mode 100644 playground/SqlServerEndToEnd/azure.yaml delete mode 100644 playground/SqlServerEndToEnd/next-steps.md diff --git a/Aspire.sln b/Aspire.sln index b96f0767876..9b7c97973bc 100644 --- a/Aspire.sln +++ b/Aspire.sln @@ -205,6 +205,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Pomelo.EntityFramewo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Pomelo.EntityFrameworkCore.MySql.Tests", "tests\Aspire.Pomelo.EntityFrameworkCore.MySql.Tests\Aspire.Pomelo.EntityFrameworkCore.MySql.Tests.csproj", "{BFAF55A8-A737-4EC1-BBA2-76001A8F16E0}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SqlServerEndToEnd", "SqlServerEndToEnd", "{2CA6AB88-21EF-4488-BB1B-3A5BAD5FE2AD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SqlServerEndToEnd.AppHost", "playground\SqlServerEndToEnd\SqlServerEndToEnd.AppHost\SqlServerEndToEnd.AppHost.csproj", "{7616FD70-6BEC-439D-B39E-A838F939C0F9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SqlServerEndToEnd.ApiService", "playground\SqlServerEndToEnd\SqlServerEndToEnd.ApiService\SqlServerEndToEnd.ApiService.csproj", "{78ABCF96-507B-4E5F-9265-CACC3EFD4C53}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -551,6 +557,14 @@ Global {BFAF55A8-A737-4EC1-BBA2-76001A8F16E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {BFAF55A8-A737-4EC1-BBA2-76001A8F16E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {BFAF55A8-A737-4EC1-BBA2-76001A8F16E0}.Release|Any CPU.Build.0 = Release|Any CPU + {7616FD70-6BEC-439D-B39E-A838F939C0F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7616FD70-6BEC-439D-B39E-A838F939C0F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7616FD70-6BEC-439D-B39E-A838F939C0F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7616FD70-6BEC-439D-B39E-A838F939C0F9}.Release|Any CPU.Build.0 = Release|Any CPU + {78ABCF96-507B-4E5F-9265-CACC3EFD4C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78ABCF96-507B-4E5F-9265-CACC3EFD4C53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78ABCF96-507B-4E5F-9265-CACC3EFD4C53}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78ABCF96-507B-4E5F-9265-CACC3EFD4C53}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -647,6 +661,9 @@ Global {25208C6F-0A9D-4D60-9EDD-256C9891B1CD} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0} {C565532A-0754-44FE-A0C7-78D5338DDBCA} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2} {BFAF55A8-A737-4EC1-BBA2-76001A8F16E0} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60} + {2CA6AB88-21EF-4488-BB1B-3A5BAD5FE2AD} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0} + {7616FD70-6BEC-439D-B39E-A838F939C0F9} = {2CA6AB88-21EF-4488-BB1B-3A5BAD5FE2AD} + {78ABCF96-507B-4E5F-9265-CACC3EFD4C53} = {2CA6AB88-21EF-4488-BB1B-3A5BAD5FE2AD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C} diff --git a/playground/SqlServerEndToEnd/.gitignore b/playground/SqlServerEndToEnd/.gitignore deleted file mode 100644 index 8e84380248d..00000000000 --- a/playground/SqlServerEndToEnd/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.azure diff --git a/playground/SqlServerEndToEnd/azure.yaml b/playground/SqlServerEndToEnd/azure.yaml deleted file mode 100644 index 1637c654f5c..00000000000 --- a/playground/SqlServerEndToEnd/azure.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json - -name: SqlServerEndToEnd -services: - app: - language: dotnet - project: .\SqlServerEndToEnd.AppHost\SqlServerEndToEnd.AppHost.csproj - host: containerapp diff --git a/playground/SqlServerEndToEnd/next-steps.md b/playground/SqlServerEndToEnd/next-steps.md deleted file mode 100644 index a0803b523c5..00000000000 --- a/playground/SqlServerEndToEnd/next-steps.md +++ /dev/null @@ -1,69 +0,0 @@ -# Next Steps after `azd init` - -## Table of Contents - -1. [Next Steps](#next-steps) -2. [What was added](#what-was-added) -3. [Billing](#billing) -4. [Troubleshooting](#troubleshooting) - -## Next Steps - -### Provision infrastructure and deploy application code - -Run `azd up` to provision your infrastructure and deploy to Azure in one step (or run `azd provision` then `azd deploy` to accomplish the tasks separately). Visit the service endpoints listed to see your application up-and-running! - -To troubleshoot any issues, see [troubleshooting](#troubleshooting). - -### Configure CI/CD pipeline - -1. Create a workflow pipeline file locally. The following starters are available: - - [Deploy with GitHub Actions](https://github.com/Azure-Samples/azd-starter-bicep/blob/main/.github/workflows/azure-dev.yml) - - [Deploy with Azure Pipelines](https://github.com/Azure-Samples/azd-starter-bicep/blob/main/.azdo/pipelines/azure-dev.yml) -2. Run `azd pipeline config -e ` to configure the deployment pipeline to connect securely to Azure. An environment name is specified here to configure the pipeline with a different environment for isolation purposes. Run `azd env list` and `azd env set` to reselect the default environment after this step. - -## What was added - -### Infrastructure configuration - -To describe the infrastructure and application and `azure.yaml` was added with the following directory structure: - -```yaml -- azure.yaml # azd project configuration -``` - -This file contains a single service, which references your project's App Host. When needed, `azd` generates the required infrastructure as code in memory and uses it. - -If you would like to see or modify the infrastructure that `azd` uses, run `azd infra synth` to persist it to disk. - -If you do this, some additional directories will be created: - -```yaml -- infra/ # Infrastructure as Code (bicep) files - - main.bicep # main deployment module - - resources.bicep # resources shared across your application's services -``` - -In addition, for each project resource referenced by your app host, a `containerApp.tmpl.yaml` file will be created in a directory named `manifests` next the project file. This file contains the infrastructure as code for running the project on Azure Container Apps. - -*Note*: Once you have synthesized your infrastructure to disk, changes made to your App Host will not be reflected in the infrastructure. You can re-generate the infrastructure by running `azd infra synth` again. It will prompt you before overwriting files. You can pass `--force` to force `azd infra synth` to overwrite the files without prompting. - -*Note*: `azd infra synth` is currently an alpha feature and must be explicitly enabled by running `azd config set alpha.infraSynth on`. You only need to do this once. - -## Billing - -Visit the *Cost Management + Billing* page in Azure Portal to track current spend. For more information about how you're billed, and how you can monitor the costs incurred in your Azure subscriptions, visit [billing overview](https://learn.microsoft.com/en-us/azure/developer/intro/azure-developer-billing). - -## Troubleshooting - -Q: I visited the service endpoint listed, and I'm seeing a blank or error page. - -A: Your service may have failed to start or misconfigured. To investigate further: - -1. Click on the resource group link shown to visit Azure Portal. -2. Navigate to the specific Azure Container App resource for the service. -3. Select *Monitoring -> Log stream* under the navigation pane. -4. Observe the log output to identify any errors. -5. If logs are written to disk, examine the local logs or debug the application by using the *Console* to connect to a shell within the running container. - -For additional information about setting up your `azd` project, visit our official [docs](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/make-azd-compatible?pivots=azd-convert).