Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-bang committed Jan 1, 2025
1 parent b242467 commit ddfb7d9
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/AuthZero.AppHost/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.azure
6 changes: 3 additions & 3 deletions src/AuthZero.AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@



builder.AddProject<Projects.AuthZero_AccountService_WebApi>("AccountService-WebApi")
builder.AddProject<Projects.AuthZero_AccountService_WebApi>("account-api")
.WithReference(sqlServerAccountService).WaitFor(sqlServerAccountService)
.WithReference(kafka)
.WithReference(caching);

builder.AddProject<Projects.NotificationService_WebApi>("NotificationService-WebApi")
builder.AddProject<Projects.NotificationService_WebApi>("notification-api")
.WithReference(kafka);


builder.AddProject<Projects.AuthZero_WebApp>("AuthZero-WebApp");
builder.AddProject<Projects.AuthZero_WebApp>("webapp");

await builder.Build().RunAsync();
8 changes: 8 additions & 0 deletions src/AuthZero.AppHost/azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json

name: authzero-apphost
services:
app:
language: dotnet
project: ./AuthZero.AppHost.csproj
host: containerapp
Binary file modified src/AuthZero.AppHost/bin/Debug/net9.0/AuthZero.AppHost.dll
Binary file not shown.
Binary file modified src/AuthZero.AppHost/bin/Debug/net9.0/AuthZero.AppHost.pdb
Binary file not shown.
74 changes: 74 additions & 0 deletions src/AuthZero.AppHost/next-steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 <environment name>` 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, an `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/azure/developer/intro/azure-developer-billing).

## Troubleshooting

Q: I visited the service endpoint listed, and I'm seeing a blank page, a generic welcome page, or an error page.

A: Your service may have failed to start, or it may be missing some configuration settings. To investigate further:

1. Run `azd show`. Click on the link under "View in Azure Portal" to open the resource group in Azure Portal.
2. Navigate to the specific Container App service that is failing to deploy.
3. Click on the failing revision under "Revisions with Issues".
4. Review "Status details" for more information about the type of failure.
5. Observe the log outputs from Console log stream and System log stream to identify any errors.
6. If logs are written to disk, use *Console* in the navigation to connect to a shell within the running container.

For more troubleshooting information, visit [Container Apps troubleshooting](https://learn.microsoft.com/azure/container-apps/troubleshooting).

### Additional information

For additional information about setting up your `azd` project, visit our official [docs](https://learn.microsoft.com/azure/developer/azure-developer-cli/make-azd-compatible?pivots=azd-convert).
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("AuthZero.AppHost")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cfc49e41c55c9c780713d51da2ca8a4674de2409")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b242467744b9437c8f97539a8b6717a6f8a50de5")]
[assembly: System.Reflection.AssemblyProductAttribute("AuthZero.AppHost")]
[assembly: System.Reflection.AssemblyTitleAttribute("AuthZero.AppHost")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c00820c2c8e89312f528eb2a392d8db6660c1dee8727ee7488c76eb02af87436
c297e4ff4a0ec4abb6466e35816c1c37f72fde3170db17cf0c3e1003390cf901
Binary file modified src/AuthZero.AppHost/obj/Debug/net9.0/AuthZero.AppHost.dll
Binary file not shown.
Binary file modified src/AuthZero.AppHost/obj/Debug/net9.0/AuthZero.AppHost.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"/Users/mrsteve.bang/Documents/_projects/authzero/*":"https://raw.githubusercontent.com/steve-bang/AuthZero/cfc49e41c55c9c780713d51da2ca8a4674de2409/*"}}
{"documents":{"/Users/mrsteve.bang/Documents/_projects/authzero/*":"https://raw.githubusercontent.com/steve-bang/AuthZero/b242467744b9437c8f97539a8b6717a6f8a50de5/*"}}
Binary file modified src/AuthZero.AppHost/obj/Debug/net9.0/ref/AuthZero.AppHost.dll
Binary file not shown.
Binary file not shown.

0 comments on commit ddfb7d9

Please sign in to comment.