A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/pipeline-github-actions below:

Configure a pipeline using GitHub Actions

In this article, you'll learn how to use the Azure Developer CLI (azd) to create a GitHub Actions CI/CD pipeline for an azd template. This pipeline enables you to push template updates to a code repository and have your changes automatically provisioned and deployed to your Azure environment.

Prerequisites Initialize the template

This example uses the Hello-AZD template, but you can follow these steps for any azd template that includes a pipeline definition file (typically found in the .github or .azdo folders).

  1. In an empty directory, initialize the hello-azd template:

    azd init -t hello-azd
    
  2. When prompted, enter a name for the environment, such as helloazd.

Create a pipeline using GitHub Actions

Follow these steps to create and configure a pipeline:

  1. In a terminal at the root of your template, run:

    azd pipeline config
    
  2. When prompted to select a provider, choose GitHub.

    ? Select a provider:  [Use arrows to move, type to filter]
    > GitHub
      Azure DevOps
    
  3. Select your desired Azure subscription and region.

  4. When prompted to configure your remote repository, choose Create a new private GitHub repository. If you have an existing project you'd like to use, you can also choose Select an existing GitHub project.

    ? How would you like to configure your git remote to GitHub?  [Use arrows to move, type to filter]
      Select an existing GitHub project
    > Create a new private GitHub repository
      Enter a remote URL directly
    
  5. Enter a name for the new repository.

  6. When prompted to commit and push your local changes to start a new GitHub Actions run, enter y.

  7. Review the output in the terminal. The azd pipeline config command displays the GitHub repository name for your project.

    Note

    By default, azd pipeline config configures OpenID Connect (OIDC), also called federated credentials. To use client credentials instead, run azd pipeline config --auth-type client-credentials.

    OIDC/federated credentials are not supported for Terraform.

    Learn more about OIDC support in azd.

  8. In your browser, open the GitHub repository for your project.

  9. Select Actions to see the workflow running.

Test the pipeline with a code change
  1. In the project's /src/components/pages directory, open Home.razor.

  2. Locate the Hello AZD! header text near the top of the file.

  3. Change the text to Hello, pipeline!.

  4. Save the file.

  5. Commit and push your change. This action triggers the GitHub Actions pipeline to deploy the update.

  6. In your browser, open your project's GitHub repository to see:

  7. Select Actions to see the test update reflected in the workflow.

  8. To view the deployed update, visit the web frontend URL provided in the azd output.

Use azd as a GitHub Action

You can install azd as a GitHub Action using the setup-azd action. To use it, add the following to your .github/workflows/azure-dev.yml file:

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Install azd
        uses: Azure/setup-azd@v1.0.0
Clean up resources

When you no longer need the Azure resources created in this article, run the following command:

azd down

This command removes all Azure resources associated with your project.

Next steps

Monitor your app using Azure Developer CLI (azd)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4