Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 6, 2025

Overview

This PR adds a GitHub Actions workflow that automates Azure infrastructure provisioning and deployment using the Azure Developer CLI (azd). This addresses issue #[issue_number] by providing a CI/CD pipeline for consistent, automated infrastructure management.

Changes

Added .github/workflows/azure-dev.yml

A new workflow that:

  • Triggers: Runs on push to main branch or manual dispatch via GitHub Actions UI
  • Authentication: Uses Azure federated credentials (OIDC) for secure, keyless authentication
  • Steps:
    1. Checks out the repository
    2. Installs Azure Developer CLI
    3. Authenticates with Azure using federated credentials
    4. Provisions infrastructure with azd provision --no-prompt
    5. Deploys the application with azd deploy --no-prompt

Updated AGENTS.md

Added documentation for the new workflow in the GitHub Workflows section, including required variables and authentication details.

Configuration Requirements

For repository administrators to enable this workflow, the following repository variables must be configured in GitHub Settings:

  • AZURE_CLIENT_ID - Service principal client ID
  • AZURE_TENANT_ID - Azure tenant ID
  • AZURE_SUBSCRIPTION_ID - Azure subscription ID
  • AZURE_ENV_NAME - Environment name (e.g., "python-demos-prod")
  • AZURE_LOCATION - Azure region (e.g., "eastus")

These can be configured by running azd pipeline config locally, which sets up the federated credentials and GitHub repository variables automatically.

Benefits

  • Automated provisioning: Infrastructure is automatically provisioned on pushes to main
  • Consistency: Ensures environments are created the same way every time
  • Security: Uses OIDC federation instead of long-lived credentials
  • Best practices: Follows standard patterns used across Azure Samples repositories
  • Reproducibility: Makes it easy to recreate environments for testing or disaster recovery

Testing

  • ✅ YAML syntax validated
  • ✅ Workflow structure follows Azure Samples standards
  • ✅ All required variables properly referenced
  • ✅ Documentation updated

Fixes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Add azd provision workflow to automate Azure infrastructure provisioning</issue_title>
<issue_description>This repository lacks a GitHub Actions workflow within .github/workflows/ that runs azd provision.

Adding a CI workflow that provisions (and later deploys) infrastructure via the Azure Developer CLI improves reliability and makes onboarding smoother.

Required Action

Add a workflow similar to the standard azure-dev.yaml used in Azure Samples. A minimal example:

name: Deploy to Azure with azd
on:
  workflow_dispatch:
  push:
    branches: [ main ]

permissions:
  id-token: write
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Install azd
        uses: Azure/setup-azd@v2

      - name: Azure login (federated)
        run: |
          azd auth login --client-id "$AZURE_CLIENT_ID" \
            --tenant-id "$AZURE_TENANT_ID" --federated-credential-provider github
        env:
          AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
          AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}

      - name: Provision Infrastructure
        run: |
          azd provision --no-prompt
        env:
          AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
          AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
          AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}

      - name: Deploy Application
        run: |
          azd deploy --no-prompt
        env:
          AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
          AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
          AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}

For a more complete example (including environment variables based off main.parameters.json),
see https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/.github/workflows/azure-dev.yml

Rationale

  • Ensures infra is provisioned consistently by automation
  • Enables repeatable environments via azd
  • Aligns with current Azure Developer CLI best practices

After adding the workflow, ensure required org/repo variables and federated credentials are configured (run azd pipeline config locally if needed).</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #7

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Add azd provision workflow to automate Azure infrastructure provisioning Add azure-dev.yml workflow for automated Azure infrastructure provisioning Oct 6, 2025
@Copilot Copilot AI requested a review from pamelafox October 6, 2025 23:51
Copilot finished work on behalf of pamelafox October 6, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add azd provision workflow to automate Azure infrastructure provisioning

2 participants