verify-dotnet-samples

How to build, run and verify the .NET sample projects in the Agent Framework repository. Use this when a user wants to verify that the samples still function…

npx skills add https://github.com/microsoft/agent-framework --skill verify-dotnet-samples

Verifying .NET Sample Projects

Sample Pre-requisites

We should only support verifying samples that:

  1. Use environment variables for configuration.
  2. Have no complex setup requirements, e.g., where multiple applications need to be run together, or where we need to launch a browser, etc.

Always report to the user which samples were run and which were not, and why.

Verifying a sample

Samples should be verified to ensure that they actually work as intended and that their output matches what is expected. For each sample that is run, output should be produced that shows the result and explains the reasoning about what output was expected, what was produced, and why it didn't match what the sample was expected to produce.

Steps to verify a sample:

  1. Read the code for the sample
  2. Check what environment variables are required for the sample
  3. Check if each environment variable has been set
  4. If there are any missing, give the user a list of missing environment variables to set and terminate
  5. Summarize what the expected output of the sample should be
  6. Run the sample
  7. Show the user any output from the sample run as it gets produced, so that they can see the run progress
  8. Check the output of the run against expectations
  9. After running all requested samples, produce output for each sample that was verified:
  10. If expectations were matched, output the following:
    [Sample Name] Succeeded
    
  11. If expectations were not matched, output the following:
    [Sample Name] Failed
    Actual Output:
    [What the sample produced]
    Expected Output:
    [Explanation of what was expected and why the actual output didn't match expectations]
    

Environment Variables

Most samples use environment variables to configure settings.

var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";

To run a sample, the environment variables should be set first. Before running a sample, check whether each environment variable in the sample has a value and then give the user a list of environment variables to set.

You can provide the user some examples of how to set the variables like this:

export AZURE_OPENAI_ENDPOINT="https://my-openai-instance.openai.azure.com/"
export AZURE_OPENAI_DEPLOYMENT_NAME="gpt-4o-mini"

To check if a variable has a value use e.g.:

echo $AZURE_OPENAI_ENDPOINT

How to Run a Sample (General Pattern)

cd dotnet/samples/<category>/<sample-dir>
dotnet run

For multi-targeted projects (e.g., Durable console apps), specify the framework:

dotnet run --framework net10.0

More skills from microsoft

oss-growth
microsoft
OSS growth hacker persona
agent-framework-azure-ai-py
microsoft
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai). Use when creating persistent agents with AzureAIAgentsProvider, using hosted tools (code interpreter, file search, web search), integrating MCP servers, managing conversation threads, or implementing streaming responses. Covers function tools, structured outputs, and multi-tool agents.
development
airunway-aks-setup
microsoft
Set up AI Runway on AKS — from bare cluster to running model. Covers cluster verification, controller install, GPU assessment, provider setup, and first deployment. WHEN: "setup AI Runway", "onboard AKS cluster", "install AI Runway", "airunway setup", "deploy model to AKS", "GPU inference on AKS", "KAITO setup on AKS", "run LLM on AKS", "vLLM on AKS", "set up model serving on AKS", "AI Runway controller".
devops
appinsights-instrumentation
microsoft
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
devops
applicationinsights-web-ts
microsoft
Instrument browser/web apps with the Application Insights JavaScript SDK (@microsoft/applicationinsights-web). Use for Real User Monitoring (RUM) — page views, clicks, AJAX/fetch dependencies, exceptions, custom events, and browser-side GenAI agent traces correlated to backend OpenTelemetry traces. Covers SDK Loader Script and npm setup, framework extensions (React, React Native, Angular), Click Analytics, telemetry initializers, and OTel GenAI semantic conventions for agent/tool/model spans emitted from the browser.
devops
azure-ai-anomalydetector-java
microsoft
Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate/multivariate anomaly detection, time-series analysis, or AI-powered monitoring.
development
azure-ai-language-conversations-py
microsoft
Implement Conversational Language Understanding (CLU) using the azure-ai-language-conversations Python SDK. Use when working with ConversationAnalysisClient to analyze conversation intent and entities, building NLP features, or integrating language understanding into applications.
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python. Use for ML workspaces, jobs, models, datasets, compute, and pipelines. Triggers: "azure-ai-ml", "MLClient", "workspace", "model registry", "training jobs", "datasets".
development