{"id":19165,"date":"2024-02-28T23:29:06","date_gmt":"2024-02-29T07:29:06","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=19165"},"modified":"2024-02-29T04:26:00","modified_gmt":"2024-02-29T12:26:00","slug":"dev-proxy-v0-15-with-simulating-crud-apis-secured-with-microsoft-entra","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/dev-proxy-v0-15-with-simulating-crud-apis-secured-with-microsoft-entra\/","title":{"rendered":"Dev Proxy v0.15 with simulating CRUD APIs secured with Microsoft Entra"},"content":{"rendered":"<p>We\u2019re excited to announce the release of Dev Proxy v0.15, with new features that allow you to spend more time building your app and less time on things you won\u2019t be shipping.<\/p>\n<p>In this updated version:<\/p>\n<ul>\n<li>Simulate CRUD APIs secured with Microsoft Entra<\/li>\n<li>Simulate OAuth flows<\/li>\n<li>Improved monitoring URLs<\/li>\n<li>Add multiple instances of the same plugin<\/li>\n<li>More flexible simulating throttling<\/li>\n<li>Improved support for CORS<\/li>\n<li>Choose how to start Dev Proxy<\/li>\n<li>Extend Dev Proxy with custom commands<\/li>\n<li>Get notified about new beta versions<\/li>\n<li>&#8230;and more!<\/li>\n<\/ul>\n<h2>Simulate CRUD APIs secured with Microsoft Entra<\/h2>\n<p>Using the CrudApiPlugin Dev Proxy, you can simulate CRUD APIs. This is invaluable when you build apps while the underlying APIs aren\u2019t available yet.<\/p>\n<p>In this version, we extend the CrudApiPlugin with support for simulating APIs secured with Microsoft Entra. When building enterprise apps, the APIs you connect to are secured with Microsoft Entra. This feature allows you to easily simulate secured APIs without having to spend time on setting up resources you won\u2019t be shipping to production.<\/p>\n<p>When defining your CRUD API, you can choose which aspect of the access token you want to validate, like the audience, issuer, permissions or token lifetime, which is perfect for working with simulated access tokens. You can also choose to validate the token signature to ensure that the app is using a real token!<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01.png\"><img decoding=\"async\" class=\"wp-image-19208 size-full alignnone aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01.png\" alt=\"Screenshot of code, Dev Proxy simulating a CRUD API secured with Microsoft Entra\" width=\"1960\" height=\"1064\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01.png 1960w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01-300x163.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01-1024x556.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01-768x417.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_01-1536x834.png 1536w\" sizes=\"(max-width: 1960px) 100vw, 1960px\" \/><\/a><em>Dev Proxy simulating a CRUD API secured with Microsoft Entra<\/em><\/p>\n<p>Learn more about <a href=\"https:\/\/learn.microsoft.com\/microsoft-cloud\/dev\/dev-proxy\/how-to\/simulate-crud-api\">simulating CRUD APIs with Dev Proxy<\/a>.<\/p>\n<h2>Simulate OAuth flows<\/h2>\n<p>Many apps built on Microsoft cloud are secured with Microsoft Entra. Before you can access them, you need to sign in and get an access token.<\/p>\n<p>In this version we introduce the new EntraMockResponsePlugin which allows you to simulate OAuth flows. After detecting an OAuth flow, the plugin updates auth codes and simulated access tokens so that they\u2019re accepted by Microsoft Identity libraries.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/Screenshot-2024-02-27-141313.png\"><img decoding=\"async\" class=\"aligncenter wp-image-19212 size-full\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/Screenshot-2024-02-27-141313-e1709039784699.png\" alt=\"Screenshot of code, Dev Proxy simulating OAuth flow for an app built using Microsoft Graph Toolkit\" width=\"1420\" height=\"818\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/Screenshot-2024-02-27-141313-e1709039784699.png 1420w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/Screenshot-2024-02-27-141313-e1709039784699-300x173.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/Screenshot-2024-02-27-141313-e1709039784699-1024x590.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/Screenshot-2024-02-27-141313-e1709039784699-768x442.png 768w\" sizes=\"(max-width: 1420px) 100vw, 1420px\" \/><\/a><em>Dev Proxy simulating OAuth flow for an app built using Microsoft Graph Toolkit<\/em><\/p>\n<p>Stay tuned for more information and examples of using this plugin in the coming weeks.<\/p>\n<h2>Improved monitoring URLs<\/h2>\n<p>To help you reuse your presets like generating OpenAPI specs, generating mocks, and execution summaries with different APIs, in this release we introduce a new option &#8211; urlsToWatch. This option enables you to provide URLs to watch from the command line. Simply use -u or &#8211;urls-to-watch and specify the URLs you want to monitor, without having to change your presets!<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-19213\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03.png\" alt=\"Screenshot of code, Starting Dev Proxy with specifying URLs to monitor from the command line\" width=\"1961\" height=\"1347\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03.png 1961w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03-300x206.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03-1024x703.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03-768x528.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_03-1536x1055.png 1536w\" sizes=\"(max-width: 1961px) 100vw, 1961px\" \/><\/a><em>Starting Dev Proxy with specifying URLs to monitor from the command line<\/em><\/p>\n<p>In this version, we also introduce support for monitoring URLs on a specific port only! This is invaluable if you build apps, for example using .NET Aspire, where you have several APIs running locally and want to watch requests to one of them. This feature gives you fine-grained control over URL watching for a more precise developer experience.<\/p>\n<p>Learn more about <a href=\"https:\/\/learn.microsoft.com\/microsoft-cloud\/dev\/dev-proxy\/technical-reference\/proxy-settings\">Dev Proxy configuration options<\/a>.<\/p>\n<h2>Add multiple instances of the sample plugin<\/h2>\n<p>Plugins in Dev Proxy give you the ability configure it to your specific needs. Whether it\u2019s simulating specific behaviors or monitoring URLs, you\u2019re in control of how you want Dev Proxy to help you.<\/p>\n<p>Previously, we introduced the ability to add multiple instances of the same plugin. This is invaluable in cases where you want to, for example define multiple instances of CRUD APIs or define mocks which you can reuse across different presets. In this version, we improved this ability further by changing how plugins expose their command-line options, to avoid conflicts between the different instances.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-19214\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04.png\" alt=\"Screenshot of code, Sample Dev Proxy configuration with multiple instances of the same plugin\" width=\"1961\" height=\"1361\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04.png 1961w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04-300x208.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04-1024x711.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04-768x533.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/02\/TODAY_04-1536x1066.png 1536w\" sizes=\"(max-width: 1961px) 100vw, 1961px\" \/><\/a><em>Sample Dev Proxy configuration with multiple instances of the same plugin<\/em><\/p>\n<h2>More flexible simulating throttling<\/h2>\n<p>Throttling is one of the hardest API behaviors to simulate because it\u2019s elusive: it happens only when the server runs out of resources. This is one of the scenario&#8217;s where using Dev Proxy is invaluable. You can simulate throttling on-demand without incurring unnecessary load on your production APIs and see how your app handles it.<\/p>\n<p>In this version, we extend the GenericRandomErrorPlugin and GraphRandomErrorPlugin with the ability to configure the retry-after value on throttled responses. This allows you to simulate different scenarios and delays and see how they impact your application.<\/p>\n<p>Learn more about <a href=\"https:\/\/learn.microsoft.com\/microsoft-cloud\/dev\/dev-proxy\/how-to\/test-my-app-with-random-errors\">simulating random errors with Dev Proxy<\/a>.<\/p>\n<h2>Improved support for CORS<\/h2>\n<p>When building client-side apps, you typically call APIs located on other domains. For these requests to work, the API needs to support CORS (Cross-Origin Resource Sharing).<\/p>\n<p>In this release, we update the RateLimitingPlugin and RetryAfterPlugin to expose throttling information for cross-origin requests, which allows your app to properly handle throttling.<\/p>\n<p>Learn more about <a href=\"https:\/\/learn.microsoft.com\/microsoft-cloud\/dev\/dev-proxy\/how-to\/simulate-rate-limit-api-responses\">simulating rate limiting with Dev Proxy<\/a>.<\/p>\n<h2>Choose how to start Dev Proxy<\/h2>\n<p>When you start Dev Proxy, it automatically registers itself as your system-wide proxy. It also registers an SSL certificate so that it can intercept and inspect HTTPS API requests. We do this so that you can start using Dev Proxy right away with as little setup as possible.<\/p>\n<p>In this version we introduce two new options that you can use to control how you want to start Dev Proxy. By starting Dev Proxy with `&#8211;as-system-proxy false` you won\u2019t register it as your system proxy. By using `&#8211;install-cert false` Dev Proxy won\u2019t install its SSL certificate.<\/p>\n<p>Both options give you more flexibility when using Dev Proxy with different scenarios such as using Dev Proxy in a Docker container.<\/p>\n<p>Learn more about <a href=\"https:\/\/learn.microsoft.com\/microsoft-cloud\/dev\/dev-proxy\/technical-reference\/proxy-settings\">Dev Proxy configuration options<\/a>.<\/p>\n<h2>Extend Dev Proxy with custom commands<\/h2>\n<p>You keep providing us with great feedback and new ideas. In preparation for building some of them, we extend Dev Proxy with the ability for plugins to add new commands to Dev Proxy. We see this as a great way to add functionality that doesn\u2019t depend on monitoring requests but is related to Dev Proxy. Stay tuned for more updates!<\/p>\n<h2>Get notified about new beta versions<\/h2>\n<p>We strive to respond as quickly as possible to your feedback and ship new features and improvements as soon as they\u2019re ready. We find it invaluable to hear from you and want to make it as easy as possible for you to try our latest releases.<\/p>\n<p>Starting from this version, you can subscribe to new beta version notifications. Each time you start Dev Proxy, it\u2019ll check if there\u2019s a new beta version available and let you know if you can upgrade.<\/p>\n<p>Learn more about <a href=\"https:\/\/learn.microsoft.com\/microsoft-cloud\/dev\/dev-proxy\/technical-reference\/proxy-settings\">Dev Proxy configuration settings<\/a>.<\/p>\n<h2>Breaking changes<\/h2>\n<p>In this version, we introduce several breaking changes:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/microsoft\/dev-proxy\/pull\/557\">We\u2019ve changed how plugins expose options<\/a> to support the ability of adding multiple instances of the same plugin<\/li>\n<li>We\u2019ve changed <a href=\"https:\/\/github.com\/microsoft\/dev-proxy\/pull\/523\">how we keep track of throttled requests<\/a><\/li>\n<li>We\u2019ve changed <a href=\"https:\/\/github.com\/microsoft\/dev-proxy\/pull\/564\">logging and renamed logging levels<\/a><\/li>\n<\/ul>\n<p>These changes mostly affect you if you\u2019ve built custom plugins. Check out <a href=\"https:\/\/github.com\/microsoft\/dev-proxy\">our latest code<\/a> for examples of how to update your code.<\/p>\n<h2>There\u2019s more<\/h2>\n<p>There&#8217;s more! This release also includes several bug fixes and improvements. Check out the <a href=\"https:\/\/github.com\/microsoft\/dev-proxy\/releases\/tag\/v0.15.0\">release notes<\/a> for the complete list of changes in this version.<\/p>\n<h2>Try it now<\/h2>\n<p>Download Dev Proxy v0.15 today and build better apps connected to APIs!<\/p>\n<p>Thanks to <a href=\"https:\/\/github.com\/svrooij\">Stephan van Rooij<\/a>, <a href=\"https:\/\/github.com\/ohaucke\">Oliver Haucke<\/a>, <a href=\"https:\/\/github.com\/SilentSobs\">Ramesh Adhikari<\/a> and <a href=\"https:\/\/github.com\/excelsiorvita\">excelsiorvita<\/a> for contributing to this release.<\/p>\n<p>Have any questions, feedback, or suggestions? Join us on <a href=\"https:\/\/aka.ms\/devproxy\/discord\">Discord<\/a>. We can\u2019t wait to see what you create with Dev Proxy!<\/p>\n<p><em>Follow us on <a href=\"http:\/\/twitter.com\/microsoft365dev\">X (Twitter) \/ @Microsoft365Dev<\/a> and subscribe to our <a href=\"https:\/\/www.youtube.com\/microsoft365developer\">YouTube channel<\/a> to stay up to date on the latest developer news and announcements.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re excited to announce the release of Dev Proxy v0.15, with new features that allow you to spend more time building your app and less time on things you won\u2019t be shipping.<\/p>\n","protected":false},"author":74222,"featured_media":19166,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,3],"tags":[299,289,304],"class_list":["post-19165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-365-developer","category-microsoft-graph","tag-crud-apis","tag-dev-proxy","tag-microsoft-entra"],"acf":[],"blog_post_summary":"<p>We\u2019re excited to announce the release of Dev Proxy v0.15, with new features that allow you to spend more time building your app and less time on things you won\u2019t be shipping.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/19165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/74222"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=19165"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/19165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/19166"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=19165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=19165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=19165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}