<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Local-Development | The .NET Blog</title><link>https://thedotnetblog.com/tags/local-development/</link><description>Articles, tutorials and insights from the .NET community.</description><generator>Hugo</generator><language>en</language><managingEditor>@thedotnetblog (The .NET Blog)</managingEditor><webMaster>@thedotnetblog</webMaster><lastBuildDate>Fri, 28 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://thedotnetblog.com/tags/local-development/index.xml" rel="self" type="application/rss+xml"/><item><title>Run and Test AI Agents Locally with Azure Developer CLI</title><link>https://thedotnetblog.com/news/emiliano-montesdeoca/azd-run-test-ai-agents-locally/</link><pubDate>Fri, 28 Aug 2026 00:00:00 +0000</pubDate><author>Emiliano Montesdeoca</author><guid>https://thedotnetblog.com/news/emiliano-montesdeoca/azd-run-test-ai-agents-locally/</guid><description>New azd AI agent commands shorten the inner loop by starting agents locally and invoking local or remote sessions from the terminal.</description><content:encoded>&lt;h1 id="run-and-test-ai-agents-locally-with-azure-developer-cli"&gt;Run and Test AI Agents Locally with Azure Developer CLI&lt;/h1&gt;
&lt;p&gt;Original source: &lt;a href="https://devblogs.microsoft.com/azure-sdk/azd-ai-agent-run-invoke/"&gt;Azure Developer CLI (azd): Run and test AI agents locally with azd&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Agent development often has an unnecessarily slow inner loop: edit locally, deploy to a cloud endpoint, open a portal or client, send a message, then return to the editor to fix the next issue. The Azure Developer CLI&amp;rsquo;s AI agent extension adds commands that bring more of that loop into the terminal.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;azd ai agent run&lt;/code&gt; starts an agent locally, while &lt;code&gt;azd ai agent invoke&lt;/code&gt; sends a message to a running agent. The result is not a replacement for deployed testing, but it is a better place to catch obvious behavior and integration problems before spending a deployment cycle.&lt;/p&gt;
&lt;h2 id="run-and-invoke-are-separate-responsibilities"&gt;Run and Invoke Are Separate Responsibilities&lt;/h2&gt;
&lt;p&gt;The distinction between the commands is useful. &lt;code&gt;run&lt;/code&gt; starts the local process and can detect the project setup described by the extension. &lt;code&gt;invoke&lt;/code&gt; sends a message to an agent that is already running. By default, invocation can target a remote Foundry endpoint; the &lt;code&gt;--local&lt;/code&gt; option selects the local process.&lt;/p&gt;
&lt;p&gt;That explicit local/remote choice matters when both versions are available. A developer can run the local agent in one terminal, invoke it with test messages, and then deliberately compare the result with the deployed endpoint. Avoid relying on an implicit target when the behavior or data boundary matters.&lt;/p&gt;
&lt;p&gt;The extension also supports selecting a named agent when a project contains more than one. Keep those names meaningful and make the expected entry point clear in project documentation.&lt;/p&gt;
&lt;h2 id="a-better-local-inner-loop"&gt;A Better Local Inner Loop&lt;/h2&gt;
&lt;p&gt;A practical loop looks like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Modify the agent implementation in the editor.&lt;/li&gt;
&lt;li&gt;Start it with &lt;code&gt;azd ai agent run&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Send a focused message with &lt;code&gt;azd ai agent invoke --local&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Inspect logs and the response.&lt;/li&gt;
&lt;li&gt;Change the implementation and repeat.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The source describes session and conversation identifiers that persist across invocations, which makes multi-turn checks possible. That is valuable when an agent must remember a previous turn, call a tool, and then explain the result.&lt;/p&gt;
&lt;p&gt;For a .NET team, the surrounding application can run locally with &lt;code&gt;dotnet run&lt;/code&gt; while the agent process is started separately. Use test data and an explicit local configuration. The goal is to exercise the code path, not accidentally connect a development session to a production resource.&lt;/p&gt;
&lt;h2 id="what-this-means-for-net-projects"&gt;What This Means for .NET Projects&lt;/h2&gt;
&lt;p&gt;The extension&amp;rsquo;s automatic project detection is centered on the supported agent workflows described by the source, including Python and Node.js setups. A C# agent or an ASP.NET integration may need additional project-specific setup for dependencies and entry points.&lt;/p&gt;
&lt;p&gt;That is not a blocker, but it is a reason to inspect what the command actually detects. Make sure required NuGet packages are restored, the agent entry point is runnable without an IDE-only environment, and the local configuration has the same assumptions your test expects.&lt;/p&gt;
&lt;p&gt;The local loop also creates a good place for repeatable conversation tests. Write down a few turns that cover the agent&amp;rsquo;s main behavior: a normal request, a tool call, a validation failure, and a follow-up that depends on previous context. Replay those conversations after changing the agent rather than judging one successful response.&lt;/p&gt;
&lt;h2 id="local-does-not-mean-risk-free"&gt;Local Does Not Mean Risk-Free&lt;/h2&gt;
&lt;p&gt;A local process can still access network resources, environment variables, files, and credentials. Keep the permissions narrow and use a development identity. Do not copy production secrets into a local &lt;code&gt;.env&lt;/code&gt; file just because the command makes testing convenient.&lt;/p&gt;
&lt;p&gt;Conversation state is another boundary. Persistent identifiers are helpful for multi-turn testing, but they can make a test appear to pass because it inherited context from an earlier run. Start a fresh conversation when checking isolation, and record which state a test expects.&lt;/p&gt;
&lt;p&gt;Logs are an advantage of local development. Capture the request, tool activity, and failure details before changing code. That evidence is much easier to inspect locally than after a remote deployment has compressed the problem into a status message.&lt;/p&gt;
&lt;h2 id="recommendations-for-net-teams"&gt;Recommendations for .NET Teams&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add a local run and invoke step to the agent project&amp;rsquo;s developer documentation.&lt;/li&gt;
&lt;li&gt;Keep local and remote targets explicit, especially when testing data access.&lt;/li&gt;
&lt;li&gt;Create a small set of repeatable multi-turn conversation scenarios.&lt;/li&gt;
&lt;li&gt;Use development identities and test resources only.&lt;/li&gt;
&lt;li&gt;Deploy after the local behavior is understood, then run separate cloud integration checks.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The Azure Developer CLI extension makes agent development feel more like ordinary application development: edit, run, invoke, inspect, repeat. That is exactly the right direction. The fast loop should be local, while deployment validation remains a deliberate second stage.&lt;/p&gt;</content:encoded></item></channel></rss>