8000 GitHub - slamb2k/copilot-backend
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

slamb2k/copilot-backend

 
 

Repository files navigation

Next Steps after azd init

Table of Contents

  1. Next Steps
  2. What was added
  3. Billing
  4. Troubleshooting

Next Steps

Define environment variables for running services

  1. Modify or add environment variables to configure the running application. Environment variables can be configured by updating the settings node(s) for each service in main.parameters.json.
  2. For services using a database, environment variables have been pre-configured under the env node in the following files to allow connection to the database. Modify the name of these variables as needed to match your application.

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.

Configure CI/CD pipeline

  1. Create a workflow pipeline file locally. The following starters are available:
  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, azure.yaml along with Infrastructure as Code files using Bicep were added with the following directory structure:

- azure.yaml     # azd project configuration
- infra/         # Infrastructure as Code (bicep) files
  - main.bicep   # main deployment module
  - app/         # Application resource modules
  - shared/      # Shared resource modules
  - modules/     # Library modules

Each bicep file declares resources to be provisioned. The resources are provisioned when running azd up or azd provision.

More information about Bicep language.

Build from source (no Dockerfile)

Note: Build from source is currently experimental. We recommend authoring a Dockerfile for a static front-end service.

Build with Buildpacks using Oryx

If your project does not contain a Dockerfile, we will use Buildpacks using Oryx to create an image for the services in azure.yaml and get your containerized app onto Azure.

To produce and run the docker image locally:

  1. Run azd package to build the image.
  2. Copy the Image Tag shown.
  3. Run docker run -it <Image Tag> to run the image locally.

Exposed port

Oryx will automatically set PORT to a default value of 80 or 8080 depending on the language. Additionally, it will auto-configure supported web servers such as gunicorn and ASP .NET Core to listen to the target PORT. If your application already listens to the port specified by the PORT variable, the application will work out-of-the-box. Otherwise, you may need to perform one of the steps below:

  1. Update your application code or configuration to listen to the port specified by the PORT variable
  2. (Alternatively) Search for targetPort in a .bicep file under the infra/app folder, and update the variable to match the port used by the application.

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.

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 there are no errors, ensure that the ingress target port matches the port that your service listens on:
    1. Under Settings -> Ingress, ensure the Target port matches the desired port.
    2. After modifying this setting, also update the targetPort setting in the .bicep file for the service under infra/app.
  6. 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.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 42.1%
  • TypeScript 40.6%
  • Bicep 9.2%
  • Shell 4.1%
  • PowerShell 3.4%
  • Dockerfile 0.4%
  • Other 0.2%
0