{"id":14038,"date":"2023-05-30T23:23:05","date_gmt":"2023-05-31T06:23:05","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=14038"},"modified":"2023-05-30T23:23:05","modified_gmt":"2023-05-31T06:23:05","slug":"microsoft-graph-developer-proxy-v0-8-with-minimal-permissions-detection-and-improved-simulating-throttling","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-developer-proxy-v0-8-with-minimal-permissions-detection-and-improved-simulating-throttling\/","title":{"rendered":"Microsoft Graph Developer Proxy v0.8 with minimal permissions detection and improved simulating throttling"},"content":{"rendered":"<p>Build resilient and performant apps with the latest preview version of the <a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/introducing-the-microsoft-graph-developer-proxy-community-preview\/#what-is-the-microsoft-graph-developer-proxy\"><strong>Microsoft Graph Developer Proxy<\/strong><\/a>. In this new version, we\u2019re excited to introduce the preview ability to detect minimal permissions for calling Microsoft Graph APIs, improved simulation of throttling, and caching guidance.<\/p>\n<p><a href=\"https:\/\/aka.ms\/graph\/proxy\/download\">Download Microsoft Graph Developer Proxy v0.8<\/a> and check if your apps properly handle API errors.<\/p>\n<h2>Detect minimal permissions for calling Microsoft Graph APIs<\/h2>\n<p>Microsoft Graph exposes hundreds of endpoints that allow you to tap into data and insights in Microsoft 365. To use these API endpoints, you need to request a correct set of permissions. If you work on a large solution that uses many endpoints, it can be difficult to build the exact list of minimal permissions for your application.<\/p>\n<p>In this version, we\u2019re excited to introduce a preview of a <strong>new feature that shows the list of minimal Microsoft Graph API permissions for your app<\/strong>. Just start the proxy, put it in recording mode and let your app run and call Microsoft Graph APIs. After you stop recording, Developer Proxy will determine the list of minimal permissions based on the requests that it intercepted.<\/p>\n<p><img decoding=\"async\" width=\"1884\" height=\"840\" class=\"wp-image-14041\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screenshot-of-a-computer-description-automatica-5.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screenshot-of-a-computer-description-automatica-5.png 1884w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screenshot-of-a-computer-description-automatica-5-300x134.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screenshot-of-a-computer-description-automatica-5-1024x457.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screenshot-of-a-computer-description-automatica-5-768x342.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screenshot-of-a-computer-description-automatica-5-1536x685.png 1536w\" sizes=\"(max-width: 1884px) 100vw, 1884px\" \/><\/p>\n<p>Use this feature to get the list of both application- and delegated permissions. For more information about how it works, and the available configuration options, see the <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-developer-proxy\/wiki\/Detect-minimal-Microsoft-Graph-API-permissions\">documentation<\/a>.<\/p>\n<p>We\u2019re releasing this feature in preview and will continue to improve its accuracy. We\u2019d love to hear feedback on how it\u2019s working and how we can make it better.<\/p>\n<h2>Improved simulating throttling<\/h2>\n<p>When we released Developer Proxy, we\u2019d simulate forced throttling based on the exact URL match. If the chaos plugin returned a 429 error, we recorded the URL that was throttled and checked if your app was backing off for the designated amount of time. If your app called the exact URL too early, Developer Proxy would forcefully fail the request with a 429 error. Throttling on Microsoft Graph actually happens per workload, rather than by specific URL. So, if your app has been throttled while retrieving information about one user, it will likely be throttled when retrieving information about another user too.<\/p>\n<p>In this version, we <strong>improved simulating throttling and let different plugins choose how they want to implement throttling<\/strong>. Plugins can choose throttling simulation from the following:<\/p>\n<ul>\n<li><strong>Specific URLs<\/strong>. This happens for <a href=\"https:\/\/learn.microsoft.com\/graph\/metered-api-overview\">metered APIs<\/a> on Microsoft Graph<\/li>\n<li><strong>Workloads<\/strong>. This is typical behavior for most endpoints on Microsoft Graph. You\u2019ll see it when using the GraphRandomErrorPlugin.<\/li>\n<li><strong>Whole host name<\/strong>. This is typical behavior for other APIs outside of Microsoft 365. You\u2019ll see it when using the GenericRandomErrorPlugin.<\/li>\n<\/ul>\n<p>Our goal is to have this improvement give a more accurate idea of how your app will respond to throttling.<\/p>\n<h2>Caching guidance<\/h2>\n<p>One way to improve your application\u2019s performance is to ensure that it caches data where possible and doesn\u2019t retrieve the same information too frequently. Implementing caching properly isn\u2019t trivial and requires considering information such as \u201cWhat data to cache\u201d and \u201cFor how long\u201d.<\/p>\n<p>In this version of the Developer Proxy, we\u2019re introducing <strong>a new plugin that warns you when it detects the same request within the specified time window<\/strong> (5 seconds by default, but you can change it in Developer Proxy\u2019s configuration).<\/p>\n<p><img decoding=\"async\" width=\"1356\" height=\"222\" class=\"wp-image-14042\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screen-shot-of-a-computer-description-automatic.png\" alt=\"A screen shot of a computer Description automatically generated with medium confidence\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screen-shot-of-a-computer-description-automatic.png 1356w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screen-shot-of-a-computer-description-automatic-300x49.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screen-shot-of-a-computer-description-automatic-1024x168.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/05\/a-screen-shot-of-a-computer-description-automatic-768x126.png 768w\" sizes=\"(max-width: 1356px) 100vw, 1356px\" \/><\/p>\n<p>We hope this plugin makes you more aware of how your app is retrieving its data and where it could be improved to work faster.<\/p>\n<h2>What\u2019s next<\/h2>\n<h2>Publishing demo from the European Collaboration Summit<\/h2>\n<p>In May 2023 at the European Collaboration Summit, Waldek Mastykarz and Gavin Barron showed how to use Microsoft Graph Developer Proxy to build resilient production apps connected to Microsoft Graph. If you didn\u2019t attend the presentation in person, they\u2019re going to show the demo on the <a href=\"https:\/\/pnp.github.io\/#community\"><strong>Microsoft 365 and Power Platform calls<\/strong><\/a> in the coming weeks. Stay tuned for more updates.<\/p>\n<h2>Renaming Microsoft Graph Developer Proxy to Microsoft 365 Developer Proxy<\/h2>\n<p>When we released Microsoft Graph Developer Proxy, one of the first pieces of feedback we heard from you is that you\u2019d like to use it beyond Microsoft Graph, with other APIs. Even with added support for other APIs, the perception that Developer Proxy is just for Microsoft Graph remained.<\/p>\n<p>To clear any lingering confusion, <strong>we\u2019re renaming this tool to Microsoft 365 Developer Proxy<\/strong>. We\u2019ll remain focused on delivering the best experience for Microsoft Graph, and ensure Developer Proxy\u2019s configuration with other APIs, outside of Microsoft 365 as well. As part of this rename, we\u2019ll move the proxy\u2019s repository to the Microsoft GitHub organization, rename the repository to reflect the new name and change the name of the executable. You won\u2019t need to take any action to continue using Developer Proxy. We expect to complete this by the end of June.<\/p>\n<h2>Try it now<\/h2>\n<p><a href=\"https:\/\/aka.ms\/graph\/proxy\/download\">Download Microsoft Graph Developer Proxy v0.8<\/a> <strong>and check if your apps properly handle API errors.<\/strong><\/p>\n<p>We\u2019re excited about this new version and can\u2019t wait for you to try it out. We\u2019re looking forward to <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-developer-proxy\/wiki\/Get-help-and-support\">hearing from you<\/a> about these improvements and how we can continue to make the Microsoft Graph Developer Proxy even better.<\/p>\n<p>Visit our\u00a0<a href=\"https:\/\/developer.microsoft.com\/graph\" target=\"_blank\" rel=\"noopener\">Microsoft Graph Dev Center<\/a>\u00a0for more resources.\u00a0Follow us on <a href=\"https:\/\/twitter.com\/Microsoft365Dev\">@Microsoft365Dev<\/a> on Twitter to stay up to date on the latest developer news and announcements.<\/p>\n<p>Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this new version of Microsoft Graph Developer Proxy, we\u2019re excited to introduce the preview ability to detect minimal permissions for calling Microsoft Graph APIs, improved simulation of throttling, and caching guidance.<\/p>\n","protected":false},"author":74222,"featured_media":14039,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[222],"class_list":["post-14038","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-developer-proxy"],"acf":[],"blog_post_summary":"<p>In this new version of Microsoft Graph Developer Proxy, we\u2019re excited to introduce the preview ability to detect minimal permissions for calling Microsoft Graph APIs, improved simulation of throttling, and caching guidance.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/14038","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=14038"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/14038\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/14039"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=14038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=14038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=14038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}