{"id":24758505,"url":"https://github.com/microsoft/genaiops-azureaisdk-template","last_synced_at":"2025-10-11T05:31:17.407Z","repository":{"id":274510308,"uuid":"885541843","full_name":"microsoft/genaiops-azureaisdk-template","owner":"microsoft","description":"Implement GenAIOps using Azure AI Foundry with ease and jumpstart","archived":false,"fork":false,"pushed_at":"2025-04-23T13:22:06.000Z","size":469,"stargazers_count":24,"open_issues_count":3,"forks_count":36,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-10T00:12:49.394Z","etag":null,"topics":["ai","azure","deployment","evaluation","experimentation","foundry","genaiops","llmops"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"readme.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T19:42:04.000Z","updated_at":"2025-09-19T10:05:47.000Z","dependencies_parsed_at":"2025-01-27T19:34:07.338Z","dependency_job_id":"b2c23561-8d4c-4d60-8a98-f0360d7e2ff9","html_url":"https://github.com/microsoft/genaiops-azureaisdk-template","commit_stats":null,"previous_names":["microsoft/genaiops-azureaisdk-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/microsoft/genaiops-azureaisdk-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fgenaiops-azureaisdk-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fgenaiops-azureaisdk-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fgenaiops-azureaisdk-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fgenaiops-azureaisdk-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/genaiops-azureaisdk-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fgenaiops-azureaisdk-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006320,"owners_count":26084085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","azure","deployment","evaluation","experimentation","foundry","genaiops","llmops"],"created_at":"2025-01-28T16:20:35.583Z","updated_at":"2025-10-11T05:31:17.401Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GenAIOps Accelerator using Azure AI Foundry\n\nThis documentation provides a step-by-step guide to setting up, running, and managing the GenAIOps accelerator using Azure AI Foundry. It supports multiple use cases, each with a predefined folder structure and configuration files. The guide is designed to help both beginners and experienced users get started with running experiments locally and on GitHub.\n\n** detailed documentation is available in the [docs](./docs/index.md) folder. ** \n\n## Azure AI Foundry GenAIOps Features\n\n### Inner Loop - Experimentation and Evaluation\n\n* **Local Development Environment Integration**\n   - Seamless integration with VS Code and development tools for local experimentation\n   - Support for rapid prototyping and testing of Use cases\n   - Built-in version control and experiment tracking capabilities\n\n* **Customizable Evaluation Framework**\n   - Comprehensive set of out-of-box evaluators for common metrics and benchmarks\n   - Ability to create and integrate custom evaluators for specific use cases (lib folder)\n   - Automated evaluation pipelines for consistent assessment\n\n* **AI Azure Agents Integration**\n   - Native support for Azure AI agents\n   - Automated agent deployment and testing capabilities\n   - Built-in monitoring and evaluation for agent behavior\n\n### Outer Loop - Deployment and Inference\n\n* **Streamlined Deployment Pipeline**\n   - Automated deployment processes for models and associated infrastructure\n   - Integration with Azure's robust security and compliance features\n\n* **Online Evaluation and Observability**\n   - Real-time monitoring of model performance and system health\n   - Comprehensive logging and tracing capabilities across the deployment stack\n\n## Platform Capabilities\n\n* **Unified Platform Experience**\n   - Single interface for managing multiple AI use cases and workflows\n   - Centralized dashboard for monitoring all aspects of AI operations\n   - Integrated tooling for collaboration and knowledge sharing\n   - Integrated Github Actions for CI/CD\n\n* **Flexible Execution Options**\n   - Support for both cloud and local execution environments\n   - Hybrid deployment options for optimized resource utilization\n   - Seamless scaling between development and production environments\n\n* **Advanced Monitoring and Analytics**\n   - Detailed metrics and KPIs for model performance tracking\n   - Built-in tools for A/B testing and model comparison\n   - Comprehensive audit trails for regulatory compliance and governance\n\n## Table of Contents\n1. [Introduction](#1-introduction)\n2. [Repository Structure](#2-repository-structure)\n3. [Prerequisites](#3-prerequisites)\n4. [Local Execution](#4-local-execution)\n5. [GitHub Execution](#5-github-execution)\n6. [Configuration Files](#6-configuration-files)\n7. [Environment Variables](#7-environment-variables)\n8. [GitHub Workflows](#8-github-workflows)\n9. [Best Practices](#9-best-practices)\n\n---\n\n## 1. Introduction\nThe GenAIOps accelerator is designed to streamline the *development, evaluation - both offline and online, and deployment* of generative AI experiments using Azure AI Foundry. It supports multiple use cases, each with a predefined folder structure and configuration files. The accelerator allows you to run experiments locally and execution on GitHub using GitHub Actions.\n\n---\n\n## 2. Repository Structure\nThe repository has the following structure:\n\n```\ngenaiops-azureaisdk-template/\n├── .github/ # Contains github actions and workflows\n├── docs/ # Contains documentation and guides\n├── infra/ # Contains terraform code for building public infrastructure\n├── lib/ # Contains reusable code for like custom evaluators\n├── llmops/ # Main scripts for running experiments\n├── math_coding/ # sample use case folder\n├── tests/ # Contains unit tests for llmops scripts\n├── .gitignore # Contains files and folders to ignore\n├── .env.sample # Sample environment variables file\n├── README.md # Main documentation file\n```\n\nThe repository has the following structure for each use case:\n\n```\nuse_case_name/\n├── data/ # Contains datasets for evaluation\n├── flows/ # Contains flow definitions for experiments\n├── evaluation/ # Contains evaluation logic and scripts\n├── online-evaluations/ # Contains scripts for online evaluations\n├── deployment/ # Contains deployment scripts and configurations\n├── experiment.yaml # Main configuration file for the experiment\n├── experiment.\u003cenv\u003e.yaml # Environment-specific configuration files\n```\n\n---\n\n## 3. Prerequisites\nBefore getting started, ensure you have the following:\n\n- **Azure Subscription**: Access to an Azure subscription with the necessary permissions.\n- **Azure CLI**: Installed and configured on your local machine.\n- **Python 3.9 or above**: Installed on your local machine.\n- **Conda**: For managing Python environments.\n- **Git**: For version control and cloning the repository.\n- **GitHub Account**: For executing workflows and managing secrets.\n\n---\n\n## 4. Local Execution\n\n### Step 1: Clone the Repository\nClone the repository to your local machine:\n```bash\ngit clone \u003crepository_url\u003e\ncd \u003crepository_name\u003e\n```\n\nStep 2: Log in to Azure\nLog in to Azure using the Azure CLI:\n\n```bash\naz login\n```\n\nStep 3: Set Up the Python Environment\nCreate and activate a Conda environment:\n\n```bash\nconda create -n myenv python=3.9\nconda activate myenv\n```\n\n\nInstall the required Python packages:\n\n```bash\npython -m pip install -r ./.github/requirements/execute_job_requirements.txt\npython -m pip install -r ./.github/requirements/build_validation_requirements.txt\npython -m pip install -e .\n```\n\nStep 4: Configure Environment Variables\nCreate a .env file from the provided .env.sample file and populate it with the right values:\n\n```bash\ncp .env.sample .env\n```\n\nStep 5: Run the Experiment\nExecute the experiment locally:\n\n```bash \npython -m llmops.eval_experiments --environment_name dev --base_path math_coding --report_dir .\n``` \n\n\n## 5. GitHub Execution\n\nThe repository uses two primary workflows to automate validation, experimentation, and deployment:\n\n### 5.1 PR Validation Workflow (math_coding_pr_workflow.yaml)\nPurpose: Validates code quality, runs tests, and ensures build stability during pull requests.\nTriggers:\n - workflow_dispatch (manual trigger)\n - Pull requests targeting main or development branches\n - Changes to paths: math_coding/**, .github/**, or llmops/**\n\n### 5.2 CI/CD Dev Workflow (math_coding_ci_dev_workflow.yaml)\nPurpose: Executes full experimentation, evaluation, and deployment when code is merged into dev.\nTriggers:\n - workflow_dispatch (manual trigger)\n - Pushes to main or development branches\n - Changes to paths: math_coding/**, .github/**, or llmops/**\n\n\n### 5.3: Configure GitHub Secrets for each environment (pr, dev, test, prod etc):\nEnsure all secrets from the .env file are added to GitHub Secrets in your repository settings.\n\nAdditionally, add the following secrets:\na. AZURE_CREDENTIALS: Azure service principal credentials for authentication.\nb. ENABLE_TELEMETRY: Set to True to enable telemetry during execution\n\n### 5.4: Push Code to GitHub from feature branch\nPush your code to the repository:\n\n```bash\ngit add .\ngit commit -m \"Initial commit\"\ngit push origin main\n```\n\n## Key features of the GitHub workflows:\n### Reusable Workflows:\n - Both workflows reuse shared workflows (platform_pr_dev_workflow.yaml and platform_ci_dev_workflow.yaml).\n - Promotes DRY (Don’t Repeat Yourself) principles.\n\n### Input Parameters:\n - env_name: Environment to target (pr for validation, dev for deployment).\n - use_case_base_path: Path to the use case (e.g., math_coding).\n\n### Triggers:\n - PR Workflow: Runs on pull requests or manual triggers.\n - Dev Workflow: Runs on code merges to dev or manual triggers.\n\n### Path Filtering:\n - Only triggers if changes affect math_coding/**, .github/**, or llmops/**.\n\n## 6. Configuration Files\n### experiment.yaml\nThis file contains the main configuration for the experiment. \n\nExample:\n\n```yaml\n# Name of the experiment. Must match use case folder name\nname: math_coding\n\n# Description of what the experiment does\ndescription: \"This is a math coding experiment\"\n\n# Path to the flow definition file. Must match the folder structure\nflow: flows/math_code_generation\n\n# Function to be called when flow starts. Must math the flow definition\nentry_point: pure_python_flow:get_math_response\n\n# List of available connection configurations. Uses Environment Variables for secrets\n# These secrets are defined in .env file and github secrets\n# These connections are referred in experiments and evaluations\nonnections:\n  - name: aoai\n    connection_type: AzureOpenAIConnection\n    api_base: https://demoopenaiexamples.openai.azure.com/\n    api_version: 2023-07-01-preview\n    api_key: ${AOAI_API_KEY}\n    api_type: azure\n    deployment_name: ${GPT4O_DEPLOYMENT_NAME}\n  - name: gpt4o\n    connection_type: AzureOpenAIConnection\n    api_base: https://demoopenaiexamples.openai.azure.com/\n    api_version: 2023-07-01-preview\n    api_key: ${GPT4O_API_KEY}\n    api_type: azure\n    deployment_name: ${GPT4O_DEPLOYMENT_NAME}\n\n# List of connection configurations to use\nconnections_ref:\n - aoai\n - gpt4o\n\n# Environment variables needed for the experiment\nenv_vars:\n - env_var1: \"value1\"  # Static value\n - env_var2: ${GPT4O_API_KEY}  # Value from environment variable\n - PROMPTY_FILE: another_template.prompty  # Template file path\n\n# Evaluation configuration\nevaluators:\n - name: eval_f1_score  # Name of evaluator\n   flow: evaluations    # Path to evaluation flow\n   entry_point: pure_python_flow:get_math_response  # Evaluation function\n   connections_ref:     # Connections for evaluation\n     - aoai\n     - gpt4o\n   env_vars:           # Environment variables for evaluation\n     - env_var3: \"value1\"\n     - env_var4: ${GPT4O_API_KEY}\n     - ENABLE_TELEMETRY: True\n   datasets:           # Test datasets configuration\n     - name: math_coding_test\n       source: data/math_data.jsonl  # Path to test data\n       description: \"This dataset is for evaluating flows.\"\n       mappings:      # How to map data fields\n         ground_truth: \"${data.answer}\"    # Expected output\n         response: \"${target.response}\"    # Actual output\n```\n\n### Environment specific experiment.yaml\nEnvironment-specific configuration files (e.g., experiment.dev.yaml) and it can override settings in experiment.yaml.\n\n\n## 7. Environment Variables\nThe .env file contains sensitive information such as API keys and connection strings. Ensure this file is not committed to the repository. Example .env file:\n\n```bash \nGPT4O_API_KEY=your_api_key_here\nAOAI_API_KEY=your_aoai_key_here\n```\n\n## 8. Best Practices\nSecrets Management: Always store sensitive information in GitHub Secrets or .env files.\nEnvironment Isolation: Use separate environments (e.g., dev, test, prod) for different stages of development.\nVersion Control: Regularly commit and push changes to GitHub to ensure code is backed up and workflows are triggered.# genaiops-azureaisdk-template\n\n## **9. Infrastructure Deployment with Terraform**\nThe repository includes Terraform code (`infra/terraform/`) for provisioning required **Azure infrastructure**:\n\n✅ **Resource Group**  \n✅ **Azure Storage Account**  \n✅ **Azure Key Vault**  \n✅ **Application Insights**  \n✅ **Azure AI Services \u0026 AI Hub**  \n✅ **Azure Container Registry**  \n\n### **9.1 Prerequisites**\nEnsure the following before deploying the infrastructure:\n\n- **Azure Subscription** with appropriate permissions (Contributor or Owner).  \n- **Azure CLI** installed and configured (`az login`).  \n- **Terraform CLI** installed ([Terraform Download](https://developer.hashicorp.com/terraform/downloads)).  \n- **GitHub Secrets** configured for authentication:\n  - `AZURE_CREDENTIALS` (Service Principal JSON for authentication)\n  - `STORAGE_ACCOUNT_NAME`\n  - `STORAGE_CONTAINER_NAME`\n  - `STORAGE_RG_NAME`\n  - `AZURE_SUBSCRIPTION_ID`\n  - `TF_STATE_KEY`\n\n---\n\n### **9.2 Deploying via GitHub Actions**\nTerraform deployment is automated using **GitHub Actions**.\n\n#### **Triggering the Deployment**\n1. Navigate to **GitHub Actions** in your repository.  \n2. Select **Terraform Deployment Workflow**.  \n3. Click **Run workflow** to trigger an infrastructure deployment.\n\n#### **GitHub Workflow Highlights**\n- **Terraform Plan \u0026 Validate**: Ensures the infrastructure is valid before applying.  \n- **Terraform Apply**: Deploys changes automatically upon manual trigger.  \n- **Remote State Storage**: Uses **Azure Storage** to store Terraform state for consistency.  \n\n📌 **Workflow File:**  \nThe deployment workflow is located in `.github/workflows/infra_deploy_terraform_workflow.yaml`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fgenaiops-azureaisdk-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fgenaiops-azureaisdk-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fgenaiops-azureaisdk-template/lists"}