Microsoft has released version 0.25 of DevProxy, an API simulation command-line tool. The new version improves the tool's configuration management and adds a couple of usability features. The project is also added to the .NET Foundation, a non-profit organisation to support the .NET platform ecosystem.
DevProxy (formerly known as Microsoft 365 Developer Proxy) helps developers to add resilience to their API-related code by simulating a vast number of API and network behaviours. By default, the tool acts as a proxy that fails half the time. It can also simulate throttling, rate-limiting or slow API responses. It can be used to mock responses to specific APIs. Combined with dev tunnels CLI, a ngrok-like tool, it can also inspect cloud services communication to understand what messages are being passed in cloud calls.
There is a new command in version 0.25, config new
, that creates a valid configuration file in the current folder. The goal is to have configuration files made easily for different scenarios.
Running devproxy -h
would display only the built-in commands due to a code filter that would exclude plugins from being loaded when global options like help are called. From this version on, the installed plugins will also be displayed in the help command output. This makes it easier for developers to discover available plugin options. To further help the developers, JSON schema URL can be specified for plugin configuration files, with IntelliSense support in Visual Studio Code.
Devproxy help now shows plugin options (source: Microsoft)
Version 0.25 improves the combination of command-line parameter --urls-to-watch
and the configuration file for mock plugin requests, where developers can specify request URL patterns. Now, in the configuration file, the request URLs can be defined as https://*/*
, allowing the command-line parameter to override them.
The new version brings a couple of breaking changes that will require some adjustments for developers using the older versions. The earlier commands named preset get
and config
are now renamed to config get
and config open
, to unify the naming in the tool. The other breaking change is the rate
parameter (which defines the request failure rate) in the config file is moved from a global setting to the plugins that use it, namely GraphRandomError
and GenericRandomError
plugin configuration.
Lastly, a timeout parameter (in seconds) can be specified for the devproxy to automatically shut down the tool if it is inactive.
DevProxy is an open-source project on GitHub and a new member of the .NET Foundation non-profit organisation. The complete release notes for this version are available on the site. There are 23 contributors and 54 open issues at the moment. The project has been starred 608 times.