Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Note
The azd pipeline config
command is in beta. For details, see the feature versioning and release strategy.
Prerequisites
- Install the Azure Developer CLI.
- Visual Studio Code installed.
Initialize the template
This example uses the Hello-AZD template, but you can follow these steps for any template that includes a pipeline definition file (typically found in the .github
or .azdo
folders).
In an empty directory, initialize the
hello-azd
template:azd init -t hello-azd
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:
In a terminal at the root of your template, run:
azd pipeline config
Provide the requested GitHub information.
When prompted to commit and push your local changes to start a new GitHub Actions run, enter
y
.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, runazd pipeline config --auth-type client-credentials
.OIDC/federated credentials are not supported for Terraform.
In your browser, open the GitHub repository for your project.
Select Actions to see the workflow running.
Push a code change
In the project's
/src/components/pages
directory, openHome.razor
.Locate the
Hello AZD!
header text near the top of the file.Change the text to
Hello, pipeline!
.Save the file.
Commit and push your change. This triggers the GitHub Actions pipeline to deploy the update.
In your browser, open your project's GitHub repository to see:
- Your commit
- The commit from GitHub Actions being set up
Select Actions to see the test update reflected in the workflow.
To view the update, visit the web frontend URL.
Use azd
as a GitHub Action
Install azd
as a GitHub Action. To use it, add the following to .github/workflows/azure-dev.yml
:
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install azd
uses: Azure/setup-azd@v0.1.0
Clean up resources
When you no longer need the Azure resources created in this article, run:
azd down