{"id":329821,"date":"2022-02-18T15:02:03","date_gmt":"2022-02-18T15:02:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=329821"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=329821","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Microsoft Dataverse Web API \u0438 \u043d\u0435 \u043f\u043b\u0435\u0432\u0430\u0442\u044c\u0441\u044f<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u0434\u0430 \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u0438\u043b\u0438 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u0433\u0430\u0445 \u0438\u043b\u0438 \u043d\u0430 StackOverflow. \u041d\u043e \u0432\u043e\u0442 \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b Azure Functions c \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 Dataverse, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 <a href=\"https:\/\/powerapps.microsoft.com\/\">Power Apps<\/a> (\u0447\u0430\u0441\u0442\u044c <a href=\"https:\/\/powerplatform.microsoft.com\/\">Power Platform<\/a>), \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043a\u0440\u0443\u043f\u0438\u0446\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2013 \u0411\u043e\u0440\u0438\u0441 \u0428\u0438\u043c\u0431\u0435\u0440\u0435\u0432, .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 EPAM. \u0411\u043e\u0440\u0438\u0441 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u044b\u0441\u043b\u0438\u043c\u044b\u043c\u0438 \u0438 \u043d\u0435\u043c\u044b\u0441\u043b\u0438\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/data-platform\/data-platform-intro\">Microsoft Dataverse<\/a>. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0421\u0423\u0411\u0414 \u0438 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u043a\u0430\u043c\u0438.<\/p>\n<blockquote>\n<p><strong>Disclaimer!<\/strong> \u041d\u0435 \u043c\u043e\u0433\u0443 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u043f\u043e Miscrosoft Dataverse, \u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043d\u0438\u043c \u0443\u0437\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u043e\u0431\u0435\u0441\u0441\u0443\u0434\u044c\u0442\u0435.<\/p>\n<\/blockquote>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Dataverse<\/h2>\n<p>\u0415\u0441\u043b\u0438 Microsoft Power Platform \u2013 \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0435 \u043a\u043e\u0440\u043e\u0431\u043e\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430 \u0437\u0430\u0434\u0430\u0447 \u0431\u0438\u0437\u043d\u0435\u0441\u0430, \u0442\u043e Dataverse \u2013 \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0442\u0430\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0411\u0430\u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 (\u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u0432 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f) \u0442\u0430\u0431\u043b\u0438\u0446-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b, \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c, \u0440\u043e\u043b\u0438, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0434 \u0441\u043e\u0431\u043e\u0439 Microsoft Azure SQL, \u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0441\u043b\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0430\u0434 \u043d\u0435\u0439, \u043b\u0443\u0447\u0448\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e Dataverse \u043a\u0430\u043a \u043e \u0421\u0423\u0411\u0414 \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Power Platform.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u0437\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u043e\u0431\u043b\u0438\u0447\u0438\u0438 Microsoft Dynamics CRM (\u0430 \u0434\u0430\u043b\u0435\u0435 XRM, Dynamics 365 \u0438 \u0434\u043e \u043d\u043e\u044f\u0431\u0440\u044f 2020 \u2013 Common Data Service \u0438\u043b\u0438 CDS). \u041c\u043d\u043e\u0433\u043e \u0440\u0435\u0431\u0440\u0435\u043d\u0434\u0438\u043d\u0433\u0430 \u2013 \u043b\u0435\u0433\u043a\u043e \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c Microsoft Dataverse \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/dataverse.org\/\">The Dataverse Project<\/a>, \u0443 \u043d\u0438\u0445 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0451 API.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 Microsoft Dataverse, \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.xrmtoolbox.com\/\">XrmToolBox<\/a>, \u0432 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0430\u0437\u043e\u0439.<\/p>\n<p>\u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0438\u0437 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Microsoft (Azure, PowerBi) \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u044b, \u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b Dataverse c Azure Functions. \u0414\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430: Organization Service \u0438 Web API.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/org-service\/overview\">Organization Service<\/a> \u2013 \u044d\u0442\u043e SOAP \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0435 \u0431\u0430\u0437\u044b. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e Microsoft, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/webapi\/overview\">Web API<\/a> \u2013 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Dataverse, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 OData 4.0. \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u0432 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u043c \u0432\u0438\u0434\u0435 OData (\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u0440\u043c <em>skip<\/em>), \u0442\u0430\u043a \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/use-fetchxml-construct-query\">FetchXML<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e page \u0438 count \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FetchXML \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 JOIN, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8fa\/adf\/e3b\/8faadfe3be9603b936827ac4b897d917.png\" width=\"316\" height=\"316\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8fa\/adf\/e3b\/8faadfe3be9603b936827ac4b897d917.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 Dataverse \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438 OData \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438 FetchXML. \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u044f \u0431\u0443\u0434\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445: curl \u0437\u0430\u043f\u0440\u043e\u0441 (OData \u0438\/\u0438\u043b\u0438 FetchXML) \u0438\/\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0421#-\u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h2>\n<p>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432 Dataverse \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u043c \u043c\u0438\u0440\u0435 <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/howto-create-service-principal-portal\">Azure<\/a> \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 App registration\/Enterprise application \u0432 Active Directory. \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 (App registration) \u0435\u0439 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f Application (client) ID (\u0434\u0430\u043b\u0435\u0435 <em>8b441c8c-2cc1-405c-bf35-6cbdb1204c6d<\/em>),<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6cc\/e11\/3be\/6cce113be14bfb2a4cf464f364bc57a3.png\" width=\"1920\" height=\"841\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6cc\/e11\/3be\/6cce113be14bfb2a4cf464f364bc57a3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0430 \u0432 \u043c\u0435\u043d\u044e Certificates &amp; secrets \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (\u0434\u0430\u043b\u0435\u0435 <em>4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf<\/em>). \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Directory (tenant) ID (\u0434\u0430\u043b\u0435\u0435 <em>835d8b21-b31c-45e8-b0a6-cea337ec6d37<\/em>).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/29b\/c91\/751\/29bc91751709f348ed53bebfca6d975e.png\" width=\"1920\" height=\"844\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/29b\/c91\/751\/29bc91751709f348ed53bebfca6d975e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c <a href=\"https:\/\/admin.powerplatform.microsoft.com\/\">Power portals<\/a> \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 Environments > [ENV] > Settings > Application users, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/24f\/65a\/05c\/24f65a05c2ad3a7e2afe1d4f8ac28131.png\" width=\"1920\" height=\"642\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/24f\/65a\/05c\/24f65a05c2ad3a7e2afe1d4f8ac28131.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410\u0434\u0440\u0435\u0441 Web API \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/make.powerapps.com\/\">Power Apps<\/a> (\u0441\u043f\u0440\u0430\u0432\u0430 \u0441\u0432\u0435\u0440\u0445\u0443): Settings > Power Apps > Developer resources > Web API endpoint (\u0434\u0430\u043b\u0435\u0435 <em>your-project-development.api.crm.dynamics.com\/api\/data\/v9.2<\/em>).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ec\/56a\/2d5\/9ec56a2d516927c2ab3451ee2f96c939.png\" width=\"2550\" height=\"862\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ec\/56a\/2d5\/9ec56a2d516927c2ab3451ee2f96c939.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h2>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (\u0447\u0438\u0442\u0430\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439) \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0435, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/bocus\/dataverse-habr-intro\">GitHub<\/a>.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c0f\/227\/f9e\/c0f227f9eeba944891eafc06e9f51fa7.png\" width=\"523\" height=\"393\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c0f\/227\/f9e\/c0f227f9eeba944891eafc06e9f51fa7.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0437\u043e\u0432 \u043e\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0440\u0430\u0437\u0443 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0435). \u041e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 HTTP \u0432\u044b\u0437\u043e\u0432 \u043a Dataverse Web API \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043d\u0435\u0433\u043e. \u041f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Dataverse \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0437\u0430 \u044d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0438\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/294\/c85\/8ec\/294c858ecbfdcbf0f2c37eee6a79ef7e.png\" width=\"523\" height=\"186\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/294\/c85\/8ec\/294c858ecbfdcbf0f2c37eee6a79ef7e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0433\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/OAuth\">OAuth 2.0<\/a>. \u0414\u043b\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u0439 endpoint \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/v2-oauth2-client-creds-grant-flow#get-a-token\">Azure<\/a>.<\/p>\n<pre><code>curl https:\/\/login.microsoftonline.com\/835d8b21-b31c-45e8-b0a6-cea337ec6d37\/oauth2\/token -d \"grant_type=client_credentials&amp;client_id=8b441c8c-2cc1-405c-bf35-6cbdb1204c6d&amp;client_secret=4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf&amp;resource=https:\/\/your-project-development.api.crm.dynamics.com\"<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0451\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON:<\/p>\n<pre><code>{   \"token_type\":\"Bearer\",   \"expires_in\":\"3599\",   \"ext_expires_in\":\"3599\",   \"expires_on\":\"1641554934\",   \"not_before\":\"1641551034\",   \"resource\":\"https:\/\/your-project-development.api.crm.dynamics.com\",   \"access_token\":\"eyJ0eXAiOiJKV1Q\u2026\" } <\/code><\/pre>\n<p>\u0421\u0430\u043c \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/jwt.ms\/\">jwt.ms<\/a>. \u041e\u043a\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u043e\u0434\u043d\u0438\u043c \u0447\u0430\u0441\u043e\u043c \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Unix-%D0%B2%D1%80%D0%B5%D0%BC%D1%8F\">UNIX-time<\/a> \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445.<\/p>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u043a\u043e\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0441\u043f\u043e\u0441\u043e\u0431 \u2013 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <em>Azure.Core.TokenCredential<\/em> \u0438 \u0435\u0433\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 <em>Azure.Identity.ClientSecretCredential<\/em>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/p>\n<pre><code>using Azure.Core; using Azure.Identity; using System.Net.Http.Headers;  namespace Dataverse.Habr.Intro;  public static class AuthProvider {     public static AuthenticationHeaderValue GetAuthHeader(         string tenantId,         string clientId,         string clientSecret,         string scope)     {         var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);         var tokenRequestContext = new TokenRequestContext(new[] { scope + \".default\" });         var accessToken = clientSecretCredential.GetToken(tokenRequestContext, CancellationToken.None);         return new AuthenticationHeaderValue(\"Bearer\", accessToken.Token);     } } <\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>tenantId<\/p>\n<\/td>\n<td>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 AD<\/p>\n<p>(\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438)<\/p>\n<\/td>\n<td>\n<p>835d8b21-b31c-45e8-b0a6-cea337ec6d37<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>clientId<\/p>\n<\/td>\n<td>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432 Dataverse<\/p>\n<\/td>\n<td>\n<p>8b441c8c-2cc1-405c-bf35-6cbdb1204c6d<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>clientSecret<\/p>\n<\/td>\n<td>\n<p>\u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p>4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>scope<\/p>\n<\/td>\n<td>\n<p>\u0420\u0435\u0441\u0443\u0440\u0441, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0435   \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u0449\u0443\u044e   (<em>\/.default<\/em>)<\/p>\n<\/td>\n<td>\n<p>https:\/\/your-project-development.api.crm.dynamics.com\/<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>AccessToken<\/em> \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 DateTimeOffset <em>ExpiresOn<\/em> \u0438 string <em>Token<\/em>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u043e\u0441\u0442\u0443\u043f \u043a Dataverse, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0438\u043b\u044b \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u044b. \u041d\u0435\u0442. \u041d\u0435 \u043c\u043e\u0436\u0435\u043c. \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 Dataverse. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f code-free \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043e\u0431\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c.<\/p>\n<h2>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (EntitySetName)<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/25c\/a42\/f24\/25ca42f2432a899d8857fa7e14e66922.png\" width=\"1920\" height=\"574\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/25c\/a42\/f24\/25ca42f2432a899d8857fa7e14e66922.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c (\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c) \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445. \u041c\u044b \u0432\u0438\u0434\u0438\u043c 4 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b (Display name, Plural name, Schema name, Logical name).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/221\/d26\/39b\/221d2639bb10f1b9c4e926291cd8e2a8.png\" width=\"1467\" height=\"853\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/221\/d26\/39b\/221d2639bb10f1b9c4e926291cd8e2a8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0445 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/entity-metadata\">\u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435<\/a>. \u0412\u043e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u0418\u043c\u044f<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Display name<\/p>\n<\/td>\n<td>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435<\/p>\n<\/td>\n<td>\n<p>My Table<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Logical name <\/p>\n<\/td>\n<td>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 Display name \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f   \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Logical name \u0431\u0443\u0434\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0437\u0435 \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u0441\u0445\u0435\u043c\u044b. \u041e\u043d\u043e   \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/td>\n<td>\n<p>mysch_mytable<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Schema name<\/p>\n<\/td>\n<td>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 Logical name \u0438   \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Pascal case<\/p>\n<\/td>\n<td>\n<p>mysch_MyTable<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Entity set name (\u0441\u043c.   Logical collection name \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438)<\/p>\n<\/td>\n<td>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 Logical name \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c   \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a Web API Dataverse<\/p>\n<\/td>\n<td>\n<p>mysch_mytables<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. \u041d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <s>\u0438\u043c\u0435\u043d\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/s> <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/understand-terminology\">\u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438<\/a> \u2013 \u044d\u0442\u043e <em>Entity set name,<\/em> \u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Power Apps. \u041d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<pre><code>curl https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.2 -H \"Authorization: Bearer eyJ0eXAiOiJ\u2026\"<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code>{   \"@odata.context\": \"https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.0\/$metadata\",   \"value\": [     ...     , {       \"name\": \"mysch_mytables\",       \"kind\": \"EntitySet\",       \"url\": \"mysch_mytables\"     },     ...   ] } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0435 \u0432\u044b, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0432\u044b\u0448\u0435, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.<\/p>\n<h2>\u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f<\/h2>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>curl \"https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.2\/mysch_mytables?$select=mysch_myid&amp;$filter=mysch_mytype ne null&amp;$top=3\" -H \"Authorization: Bearer eyJ0eXAiOiJ\u2026\"<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c FetchXML:<\/p>\n<pre><code>curl 'https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.2\/mysch_mytables?fetchXml=&lt;fetch top=\"3\">&lt;entity name=\"mysch_mytable\">&lt;attribute name=\"mysch_myid\" \/>&lt;filter>&lt;condition attribute=\"mysch_mytype\" operator=\"ne\" value=\"null\" \/>&lt;\/filter>&lt;\/entity>&lt;\/fetch>' -H \"Authorization: Bearer eyJ0eXAiOiJ\u2026\"<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0445 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435 \u0432\u0432\u0435\u0434\u0451\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432: <em>BaseRequest&lt;TOut><\/em> \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432,<\/p>\n<pre><code>namespace Dataverse.Habr.Intro.DataverseBase;  public abstract class BaseRequest&lt;TOut> {     public abstract HttpMethod HttpMethod { get; }     public abstract string GetRequest();     public abstract string? GetBody(); } <\/code><\/pre>\n<p><em>OdataResponse&lt;T><\/em> \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432,<\/p>\n<pre><code>using System.Text.Json.Serialization;  namespace Dataverse.Habr.Intro.DataverseBase;  public class OdataResponse&lt;T> {     [JsonPropertyName(\"@odata.context\")]     public string OdataContext { get; set; }      [JsonPropertyName(\"@Microsoft.Dynamics.CRM.fetchxmlpagingcookie\")]     public string FetchXmlPagingCookie { get; set; }      [JsonPropertyName(\"@odata.count\")]     public int Count { get; set; }      [JsonPropertyName(\"value\")]     public T Value { get; set; } } <\/code><\/pre>\n<p><em>ConnectionProvider<\/em> \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043e\u0442 Dataverse Web API,<\/p>\n<pre><code>using Dataverse.Habr.Intro.DataverseBase; using System.Net.Http.Headers; using System.Text.Json;  namespace Dataverse.Habr.Intro;  public class ConnectionProvider {     private readonly HttpClient _httpClient;      public ConnectionProvider(HttpClient httpClient) => _httpClient = httpClient;      public OdataResponse&lt;T> ProcessRequest&lt;T>(BaseRequest&lt;T> baseRequest) where T : class     {         var requestUri = baseRequest.GetRequest();         var content = baseRequest.GetBody();          var request = new HttpRequestMessage(baseRequest.HttpMethod, requestUri);          if (content != null)         {             request.Content = new StringContent(content);             request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(\"application\/json\");         }          var response = _httpClient.Send(request);          var data = response.Content.ReadAsStream();  #if DEBUG         var debugStringData = ReadResponseAsString(response);         data.Position = 0; #endif          if (response.IsSuccessStatusCode)         {             return (JsonSerializer.Deserialize&lt;OdataResponse&lt;T>>(data))!;         }          var responseContent = ReadResponseAsString(response);          var errorMessage = string.IsNullOrWhiteSpace(responseContent)             ? $\"Failed with a status of '{response.ReasonPhrase}'\"             : $\"Failed with content: {responseContent.Replace(\"\\\"\", string.Empty)}\";          throw new Exception(errorMessage);     }      private static string ReadResponseAsString(HttpResponseMessage message)         => new StreamReader(message.Content.ReadAsStream()).ReadToEnd(); } <\/code><\/pre>\n<p><em>Program.cs<\/em> \u2013 <s>\u043e\u0434\u043d\u043e \u043a\u043e\u043b\u044c\u0446\u043e, \u0447\u0442\u043e\u0431 \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435\u043c\u0438<\/s> \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438,<\/p>\n<pre><code>using Dataverse.Habr.Intro; using Dataverse.Habr.Intro.Handlers;  const string tenantId = \"835d8b21-b31c-45e8-b0a6-cea337ec6d37\"; const string clientId = \"8b441c8c-2cc1-405c-bf35-6cbdb1204c6d\"; const string clientSecret = \"4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf\"; const string scope = \"https:\/\/your-project-development.api.crm.dynamics.com\/\";  var authenticationHeader = AuthProvider.GetAuthHeader(tenantId, clientId, clientSecret, scope); Console.WriteLine($\"authenticationHeader: {authenticationHeader}\");  var httpClient = new HttpClient(); httpClient.BaseAddress = new Uri($\"{scope}api\/data\/v9.2\/\"); httpClient.DefaultRequestHeaders.Authorization = authenticationHeader;  var connectionProvider = new ConnectionProvider(httpClient);  var handlers = new IHandler[] { new GetOneField() };  foreach(var handler in handlers) {     Console.WriteLine();     Console.WriteLine($\"{handler.Text}: {handler.Handle(connectionProvider)}\"); } <\/code><\/pre>\n<p>\u0442\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>using Dataverse.Habr.Intro.DataverseBase; using System.Text.Json.Serialization;  namespace Dataverse.Habr.Intro.Handlers;  public class GetOneField : IHandler {     public string Text => \"Three rows field value\";      public string Handle(ConnectionProvider connectionProvider)     {         try         {             var result = connectionProvider.ProcessRequest(new Request());             return string.Join(\", \", result.Value.Select(i => i.Field));         }         catch (Exception ex)         {             return ex.Message;         }     }      private class Request : BaseRequest&lt;Response[]>     {         public override HttpMethod HttpMethod => HttpMethod.Get;          public override string? GetBody() => null;          public override string GetRequest() => \"mysch_mytables?$select=mysch_myid&amp;$filter=mysch_mytype ne null&amp;$top=3\";     }      private class Response     {         [JsonPropertyName(\"mysch_myid\")]         public string Field { get; set; }     } } <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f OData \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u044b-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434 \u044f \u0431\u0443\u0434\u0443 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c.<\/p>\n<h2>\u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f (FetchXML \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0434)<\/h2>\n<p>\u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f FetchXML \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/fetchxml-schema\">\u0441\u0445\u0435\u043c\u044b FetchXML<\/a>, \u0434\u043b\u044f \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f XML Schema Definition tool (<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/serialization\/xml-schema-def-tool-gen\">Xsd.exe<\/a>). \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0439:<\/p>\n<pre><code>xsd Fetch.xsd \/classes \/namespace:Dataverse.Habr.Intro.DataverseBase<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 <em>BaseRequest&lt;TOut><\/em> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>using System.Text; using System.Xml; using System.Xml.Serialization;  namespace Dataverse.Habr.Intro.DataverseBase;  public abstract class BaseRequest&lt;TOut> {     private static readonly XmlSerializerNamespaces EmptyNamespaces = GetEmptyXmlSerializerNamespaces();     private static readonly XmlWriterSettings XmlWriterSettings = new() { OmitXmlDeclaration = true };     private static readonly XmlSerializer XmlSerializer = new(typeof(FetchType));      public abstract HttpMethod HttpMethod { get; }      public abstract string GetRequest();      public abstract string? GetBody();      protected static string Serialize(FetchType fetchType)     {         var stringBuilder = new StringBuilder();         using var writer = XmlWriter.Create(stringBuilder, XmlWriterSettings);         XmlSerializer.Serialize(writer, fetchType, EmptyNamespaces);         return stringBuilder.ToString();     }      private static XmlSerializerNamespaces GetEmptyXmlSerializerNamespaces()     {         var namespaces = new XmlSerializerNamespaces();         namespaces.Add(string.Empty, string.Empty);         return namespaces;     } } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 FetchXML \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code>private class Request : BaseRequest&lt;Response[]> {     public override HttpMethod HttpMethod => HttpMethod.Get;      public override string? GetBody() => null;      public override string GetRequest() => \"mysch_mytables?fetchXml=\" + GetFetchXml();      private static string GetFetchXml()     {         var fetch = new FetchType         {             top = \"3\",             Items = new object[]             {                 new FetchEntityType                 {                     name = \"mysch_mytable\",                     Items = new object[]                     {                         new FetchAttributeType                         {                             name = \"mysch_myid\"                         },                         new filter                         {                             Items = new[]                             {                                 new condition                                 {                                     attribute = \"mysch_mytype\",                                     @operator = @operator.ne,                                     value = \"null\"                                 }                             }.ToArray&lt;object>()                         }                     }                 }             }         };          var fetchXml = Serialize(fetch);          return fetchXml;     } } <\/code><\/pre>\n<p>\u041a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438\u0437-\u0437\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u0435 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c, \u043d\u043e \u0441 \u043f\u043e\u0441\u0442\u0444\u0438\u043a\u0441\u043e\u043c Specified (\u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>distinct = true<\/em> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f <em>distinctSpecified = true<\/em>.<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f <em>object[]<\/em>, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 <em>.ToArray&lt;object>()<\/em> \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <em>IEnumerable<\/em>. \u0422\u0430\u043a \u043a\u0430\u043a \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u0435\u0442, \u043b\u0435\u0433\u043a\u043e \u0441\u043f\u0443\u0442\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043f\u043e\u043b\u0435 <em>Items<\/em>.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0435-\u0447\u0442\u043e \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0435\u0439\u0434\u0436\u0438\u043d\u0433, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 JOIN, \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443. \u0412\u043e\u0437\u044c\u043c\u0451\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u044d\u0442\u043e\u043c\u0443 SQL:<\/p>\n<pre><code>SELECT        mysch_mytable.mysch_mytype       ,COUNT(mysch_mytable.mysch_myid)              AS 'mysch_myid_Count'       ,MAX(mysch_mytable.createdon)                 AS 'createdon_Max'       ,MIN(mysch_relatedtable.mysch_filesize)       AS 'mysch_filesize_Min'       FROM [dbo].[mysch_mytable] AS mysch_mytable       JOIN [dbo].[mysch_relatedtable_mysch_mytable] AS relation         ON mysch_mytable.mysch_myid = relation.mysch_mytableid       JOIN [dbo].[mysch_relatedtable] AS mysch_relatedtable         ON mysch_relatedtable.mysch_relatedtableid = relation.mysch_relatedtableid      WHERE mysch_mytable.createdon >= '2021-03-06'         AND mysch_mytable.createdon &lt; '2022-03-07'   GROUP BY mysch_mytype   ORDER BY MAX(mysch_mytable.createdon) DESC     OFFSET 3 ROWS FETCH NEXT 3 ROWS ONLY <\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>private class Request : BaseRequest&lt;Response[]> {     public override HttpMethod HttpMethod => HttpMethod.Get;      public override string? GetBody() => null;      public override string GetRequest() => \"mysch_mytables?fetchXml=\" + GetFetchXml();      private static string GetFetchXml()     {         var innerJoin = new FetchLinkEntityType         {             name = \"mysch_relatedtable_mysch_mytable\",             from = \"mysch_myid\",             to = \"mysch_mytableid\",             Items = new object[]             {                 new FetchLinkEntityType                 {                     name = \"mysch_relatedtable\",                     from = \"mysch_relatedtableid\",                     to = \"mysch_relatedtableid\",                     Items = new object[]                     {                         new FetchAttributeType                         {                             name = \"mysch_filesize\",                             aggregate = AggregateType.min,                             aggregateSpecified = true,                             alias = \"mysch_filesize_Min\"                         }                     }                 }             }         };          var items = new object[]         {             new FetchAttributeType             {                 name = \"mysch_mytype\",                 groupby = FetchBoolType.@true,                 groupbySpecified = true,                 alias = \"mysch_mytype\"             },             new FetchAttributeType             {                 name = \"mysch_myid\",                 aggregate = AggregateType.count,                 aggregateSpecified = true,                 alias = \"mysch_myid_Count\"             },             new FetchAttributeType             {                 name = \"createdon\",                 aggregate = AggregateType.max,                 aggregateSpecified = true,                 alias = \"createdon_Max\"             },             new filter             {                 Items = new object[]                 {                     new condition                     {                         attribute = \"createdon\",                         @operator = @operator.ge,                         value = \"2021-03-06\"                     },                     new condition                     {                         attribute = \"createdon\",                         @operator = @operator.lt,                         value = \"2022-03-07\"                     }                 }             },             innerJoin,             new FetchOrderType             {                 alias = \"createdon_Max\",                 descending = true             }         };          var fetch = new FetchType         {             page = \"2\",             count = \"3\",             aggregate = true,             aggregateSpecified = true,             Items = new object[]             {                 new FetchEntityType                 {                     name = \"mysch_mytable\",                     Items = items                 }             }         };          var fetchXml = Serialize(fetch);          return fetchXml;     } } <\/code><\/pre>\n<p>\u0410 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0435\u043c\u0443 FetchXML \u2013 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>&lt;fetch count=\"3\" page=\"2\" aggregate=\"true\">   &lt;entity name=\"mysch_mytable\">   &lt;attribute name=\"mysch_mytype\" alias=\"mysch_mytype\" groupby=\"true\"\/>   &lt;attribute name=\"mysch_myid\" alias=\"mysch_myid_Count\" aggregate=\"count\"\/>   &lt;attribute name=\"createdon\" alias=\"createdon_Max\" aggregate=\"max\"\/>   &lt;filter>     &lt;condition attribute=\"createdon\" operator=\"ge\" value=\"2021-03-06\"\/>     &lt;condition attribute=\"createdon\" operator=\"lt\" value=\"2022-03-07\"\/>   &lt;\/filter>   &lt;link-entity name=\"mysch_relatedtable_mysch_mytable\" to=\"mysch_mytableid\" from=\"mysch_myid\">     &lt;link-entity name=\"mysch_relatedtable\" to=\"mysch_relatedtableid\" from=\"mysch_relatedtableid\">     &lt;attribute name=\"mysch_filesize\" alias=\"mysch_filesize_Min\" aggregate=\"min\"\/>     &lt;\/link-entity>   &lt;\/link-entity>   &lt;order alias=\"createdon_Max\" descending=\"true\"\/>   &lt;\/entity> &lt;\/fetch> <\/code><\/pre>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Dataverse \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u043e\u0436\u0438\u0434\u0430\u044f SQL-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0442 \u0431\u0430\u0437\u044b, \u0442\u044b \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u0448\u044c, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SQL \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b.<\/p>\n<h2>\u0417\u0430\u043f\u0440\u043e\u0441 \u0431\u043e\u043b\u0435\u0435 5000 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0438 paging cookie<\/h2>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e (\u0445\u0435-\u0445\u0435) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u0441\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0431\u0430\u0437\u044b \u0432 5000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u00f3\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c paging cookie \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u0447\u043a\u0435. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 <em>@Microsoft.Dynamics.CRM.fetchxmlpagingcookie<\/em> (<em>FetchXmlPagingCookie<\/em>) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 <em>FetchXmlPagingCookie<\/em> \u0432 \u043e\u0442\u0432\u0435\u0442\u0435:<\/p>\n<pre><code>&lt;cookie pagenumber=\\\"2\\\" pagingcookie=\\\"%253ccookie%2520page%253d%25222%2522%253e%253cmysch_myid%2520last%253d%2522%257b2AE7C651-F554-EB11-A812-000D3A10255B%257d%2522%2520first%253d%2522%257bC296A62D-F554-EB11-A812-000D3A10255B%257d%2522%2520%252f%253e%253c%252fcookie%253e\\\" istracking=\\\"False\\\" \/><\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0432\u0430\u0436\u0434\u044b Url-\u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <em>pagingcookie<\/em>:<\/p>\n<pre><code>&lt;cookie page=\"2\">&lt;mysch_myid last=\"{2AE7C651-F554-EB11-A812-000D3A10255B}\" first=\"{C296A62D-F554-EB11-A812-000D3A10255B}\" \/>&lt;\/cookie><\/code><\/pre>\n<p>\u0414\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f XML \u0438 \u0441\u043d\u043e\u0432\u0430 Url-\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041a\u043e\u0434 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 <em>OdataResponse&lt;T><\/em>:<\/p>\n<pre><code>public string? GetPagingCookie() {     if (FetchXmlPagingCookie == null)     {         return null;     }      var match = CookieRegex.Match(FetchXmlPagingCookie);      if (match.Groups.Count != 2)     {         return null;     }      var pagingCookieTwiceEncoded = match.Groups[1].Value;     var pagingCookie = HttpUtility.UrlDecode(HttpUtility.UrlDecode(pagingCookieTwiceEncoded));      return HttpUtility.UrlEncode(HttpUtility.HtmlEncode(pagingCookie)); } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code>%26lt%3bcookie+page%3d%26quot%3b2%26quot%3b%26gt%3b%26lt%3bmysch_myid+last%3d%26quot%3b%7b2AE7C651-F554-EB11-A812-000D3A10255B%7d%26quot%3b+first%3d%26quot%3b%7bC296A62D-F554-EB11-A812-000D3A10255B%7d%26quot%3b+%2f%26gt%3b%26lt%3b%2fcookie%26gt%3b<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0447\u043a\u0438 \u043f\u043e 5000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>using Dataverse.Habr.Intro.DataverseBase; using System.Text.Json.Serialization;  namespace Dataverse.Habr.Intro.Handlers;  public class LinesCount : IHandler {     public const int MaxCount = 10_000;      public string Text => $\"Slow sequential count (max {MaxCount})\";      public string Handle(ConnectionProvider connectionProvider)     {         try         {             var count = 0;             var page = 0;             string? pagingCookie = null;              do             {                 var result = connectionProvider.ProcessRequest(new Request((++page, pagingCookie)));                 pagingCookie = result.GetPagingCookie();                 count += result.Value.Length;             } while (pagingCookie != null &amp;&amp; count &lt; MaxCount);              return count.ToString();         }         catch (Exception ex)         {             return ex.Message;         }     }      private class Request : BaseRequest&lt;Response[]>     {         private readonly (int, string?) _pageAndPagingCookie;          public Request((int, string?) pageAndPagingCookie)             => _pageAndPagingCookie = pageAndPagingCookie;          public override HttpMethod HttpMethod => HttpMethod.Get;          public override string? GetBody() => null;          public override string GetRequest()             => \"mysch_mytables?fetchXml=\" + GetFetchXml(_pageAndPagingCookie);          private static string GetFetchXml((int, string?) pageAndPagingCookie)         {             var fetch = new FetchType             {                 page = pageAndPagingCookie.Item1.ToString(),                 pagingcookie = pageAndPagingCookie.Item2,                 Items = new object[]                 {                     new FetchEntityType                     {                         name = \"mysch_mytable\",                         Items = new object[]                         {                             new FetchAttributeType                             {                                 name = \"mysch_myid\"                             }                         }.ToArray()                     }                 }             };              var fetchXml = Serialize(fetch);              return fetchXml;         }     }      private class Response     {         [JsonPropertyName(\"mysch_myid\")]         public string Field { get; set; }     } } <\/code><\/pre>\n<h2>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 Dataverse \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <em>Choice<\/em>, <em>Currency<\/em>, <em>Yes\/No<\/em> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0422\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430 \u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <em>Prefer<\/em> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <em>\u201codata.include-annotations=OData.Community.Display.V1.FormattedValue\u201d<\/em> \u0432 \u0437\u0430\u043f\u0440\u043e\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u043a\u043b\u0430\u0441\u0441 <em>BaseRequest&lt;TOut><\/em>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u0444\u043b\u0430\u0433 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<pre><code>public virtual bool ReturnFormattedValues => false;<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 <em>ConnectionProvider<\/em> \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0444\u043b\u0430\u0433\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code>if (baseRequest.ReturnFormattedValues) {     _httpClient.DefaultRequestHeaders.Add(         \"Prefer\",         \"odata.include-annotations=OData.Community.Display.V1.FormattedValue\"); } <\/code><\/pre>\n<p>\u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e (\u043a\u043e\u0434\u0443), \u0430 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>private class Request : BaseRequest&lt;Response[]> {     public override HttpMethod HttpMethod => HttpMethod.Get;      public override string? GetBody() => null;      public override bool ReturnFormattedValues => true;      public override string GetRequest() => \"mysch_mytables?$select=mypaymenttype,mystatuscode&amp;$top=1\"; }  private class Response {     [JsonPropertyName(\"mypaymenttype@OData.Community.Display.V1.FormattedValue\")]     public string PaymentTypeText { get; set; }      [JsonPropertyName(\"mystatuscode@OData.Community.Display.V1.FormattedValue\")]     public string StatusCodeText { get; set; } } <\/code><\/pre>\n<h2>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435<\/h2>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u041f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c <em>COUNT(*)<\/em> \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041b\u0438\u0431\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0430\u0447\u043a\u0430\u043c\u0438 \u043f\u043e 5000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 (\u043a\u0430\u043a \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u0432\u044b\u0448\u0435), \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <a href=\"https:\/\/docs.microsoft.com\/en-us\/dynamics365\/customer-engagement\/web-api\/retrievetotalrecordcount?view=dynamics-ce-odata-9\"><em>RetrieveTotalRecordCount<\/em><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u043d\u0438\u043c\u043a\u0430 \u0431\u0430\u0437\u044b (snapshot \u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 24-\u0451\u0445 \u0447\u0430\u0441\u043e\u0432).<\/p>\n<pre><code>curl https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.2\/RetrieveTotalRecordCount(EntityNames=[\"mysch_mytable\"]) -H \"Authorization: Bearer eyJ0eXAiOiJ\u2026\"<\/code><\/pre>\n<h2>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (429 Too Many Requests)<\/h2>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Microsoft Dataverse \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/api-limits\">\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 API<\/a> \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043c\u043a\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u043c\u043a\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0437\u043a\u0438\u0435, \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a (\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430) Retry \u0434\u043b\u044f \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0438\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u043d\u0438\u044f \u043a Microsoft Dataverse \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0448\u044c \u043f\u043b\u0435\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u0440\u043e\u0433 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u043d\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u043e\u043a. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u0447\u0443\u0434\u0435\u0441\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043d\u0435 \u0432\u0441\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b Dataverse Web API \u2013 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0442\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f: \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, LateMaterialize, SQL Hints \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0423\u0441\u043f\u0435\u0445\u043e\u0432 \u0432\u0430\u043c!<\/p>\n<p>\u0415\u0449\u0451 \u0440\u0430\u0437 <a href=\"https:\/\/github.com\/bocus\/dataverse-habr-intro\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u0434<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/epam_systems\/blog\/652093\/\"> https:\/\/habr.com\/ru\/company\/epam_systems\/blog\/652093\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u0434\u0430 \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u0438\u043b\u0438 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u0433\u0430\u0445 \u0438\u043b\u0438 \u043d\u0430 StackOverflow. \u041d\u043e \u0432\u043e\u0442 \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b Azure Functions c \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 Dataverse, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 <a href=\"https:\/\/powerapps.microsoft.com\/\">Power Apps<\/a> (\u0447\u0430\u0441\u0442\u044c <a href=\"https:\/\/powerplatform.microsoft.com\/\">Power Platform<\/a>), \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043a\u0440\u0443\u043f\u0438\u0446\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2013 \u0411\u043e\u0440\u0438\u0441 \u0428\u0438\u043c\u0431\u0435\u0440\u0435\u0432, .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 EPAM. \u0411\u043e\u0440\u0438\u0441 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u044b\u0441\u043b\u0438\u043c\u044b\u043c\u0438 \u0438 \u043d\u0435\u043c\u044b\u0441\u043b\u0438\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/data-platform\/data-platform-intro\">Microsoft Dataverse<\/a>. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0421\u0423\u0411\u0414 \u0438 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u043a\u0430\u043c\u0438.<\/p>\n<blockquote>\n<p><strong>Disclaimer!<\/strong> \u041d\u0435 \u043c\u043e\u0433\u0443 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u043f\u043e Miscrosoft Dataverse, \u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043d\u0438\u043c \u0443\u0437\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u043e\u0431\u0435\u0441\u0441\u0443\u0434\u044c\u0442\u0435.<\/p>\n<\/blockquote>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Dataverse<\/h2>\n<p>\u0415\u0441\u043b\u0438 Microsoft Power Platform \u2013 \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0435 \u043a\u043e\u0440\u043e\u0431\u043e\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430 \u0437\u0430\u0434\u0430\u0447 \u0431\u0438\u0437\u043d\u0435\u0441\u0430, \u0442\u043e Dataverse \u2013 \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0442\u0430\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0411\u0430\u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 (\u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u0432 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f) \u0442\u0430\u0431\u043b\u0438\u0446-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b, \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c, \u0440\u043e\u043b\u0438, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0434 \u0441\u043e\u0431\u043e\u0439 Microsoft Azure SQL, \u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0441\u043b\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0430\u0434 \u043d\u0435\u0439, \u043b\u0443\u0447\u0448\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e Dataverse \u043a\u0430\u043a \u043e \u0421\u0423\u0411\u0414 \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Power Platform.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u0437\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u043e\u0431\u043b\u0438\u0447\u0438\u0438 Microsoft Dynamics CRM (\u0430 \u0434\u0430\u043b\u0435\u0435 XRM, Dynamics 365 \u0438 \u0434\u043e \u043d\u043e\u044f\u0431\u0440\u044f 2020 \u2013 Common Data Service \u0438\u043b\u0438 CDS). \u041c\u043d\u043e\u0433\u043e \u0440\u0435\u0431\u0440\u0435\u043d\u0434\u0438\u043d\u0433\u0430 \u2013 \u043b\u0435\u0433\u043a\u043e \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c Microsoft Dataverse \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/dataverse.org\/\">The Dataverse Project<\/a>, \u0443 \u043d\u0438\u0445 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0451 API.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 Microsoft Dataverse, \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.xrmtoolbox.com\/\">XrmToolBox<\/a>, \u0432 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0430\u0437\u043e\u0439.<\/p>\n<p>\u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0438\u0437 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Microsoft (Azure, PowerBi) \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u044b, \u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b Dataverse c Azure Functions. \u0414\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430: Organization Service \u0438 Web API.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/org-service\/overview\">Organization Service<\/a> \u2013 \u044d\u0442\u043e SOAP \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0435 \u0431\u0430\u0437\u044b. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e Microsoft, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/webapi\/overview\">Web API<\/a> \u2013 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Dataverse, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 OData 4.0. \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u0432 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u043c \u0432\u0438\u0434\u0435 OData (\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u0440\u043c <em>skip<\/em>), \u0442\u0430\u043a \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/use-fetchxml-construct-query\">FetchXML<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e page \u0438 count \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FetchXML \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 JOIN, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 Dataverse \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438 OData \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438 FetchXML. \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u044f \u0431\u0443\u0434\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445: curl \u0437\u0430\u043f\u0440\u043e\u0441 (OData \u0438\/\u0438\u043b\u0438 FetchXML) \u0438\/\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0421#-\u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h2>\n<p>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432 Dataverse \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u043c \u043c\u0438\u0440\u0435 <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/howto-create-service-principal-portal\">Azure<\/a> \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 App registration\/Enterprise application \u0432 Active Directory. \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 (App registration) \u0435\u0439 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f Application (client) ID (\u0434\u0430\u043b\u0435\u0435 <em>8b441c8c-2cc1-405c-bf35-6cbdb1204c6d<\/em>),<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0430 \u0432 \u043c\u0435\u043d\u044e Certificates &amp; secrets \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (\u0434\u0430\u043b\u0435\u0435 <em>4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf<\/em>). \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Directory (tenant) ID (\u0434\u0430\u043b\u0435\u0435 <em>835d8b21-b31c-45e8-b0a6-cea337ec6d37<\/em>).<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c <a href=\"https:\/\/admin.powerplatform.microsoft.com\/\">Power portals<\/a> \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 Environments > [ENV] > Settings > Application users, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0410\u0434\u0440\u0435\u0441 Web API \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/make.powerapps.com\/\">Power Apps<\/a> (\u0441\u043f\u0440\u0430\u0432\u0430 \u0441\u0432\u0435\u0440\u0445\u0443): Settings > Power Apps > Developer resources > Web API endpoint (\u0434\u0430\u043b\u0435\u0435 <em>your-project-development.api.crm.dynamics.com\/api\/data\/v9.2<\/em>).<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h2>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (\u0447\u0438\u0442\u0430\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439) \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0435, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/bocus\/dataverse-habr-intro\">GitHub<\/a>.<\/p>\n<figure class=\"bordered full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0437\u043e\u0432 \u043e\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0440\u0430\u0437\u0443 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0435). \u041e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 HTTP \u0432\u044b\u0437\u043e\u0432 \u043a Dataverse Web API \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043d\u0435\u0433\u043e. \u041f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Dataverse \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0437\u0430 \u044d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0438\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<figure class=\"bordered full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0433\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/OAuth\">OAuth 2.0<\/a>. \u0414\u043b\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u0439 endpoint \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/v2-oauth2-client-creds-grant-flow#get-a-token\">Azure<\/a>.<\/p>\n<pre><code>curl https:\/\/login.microsoftonline.com\/835d8b21-b31c-45e8-b0a6-cea337ec6d37\/oauth2\/token -d \"grant_type=client_credentials&amp;client_id=8b441c8c-2cc1-405c-bf35-6cbdb1204c6d&amp;client_secret=4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf&amp;resource=https:\/\/your-project-development.api.crm.dynamics.com\"<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0451\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON:<\/p>\n<pre><code>{   \"token_type\":\"Bearer\",   \"expires_in\":\"3599\",   \"ext_expires_in\":\"3599\",   \"expires_on\":\"1641554934\",   \"not_before\":\"1641551034\",   \"resource\":\"https:\/\/your-project-development.api.crm.dynamics.com\",   \"access_token\":\"eyJ0eXAiOiJKV1Q\u2026\" } <\/code><\/pre>\n<p>\u0421\u0430\u043c \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/jwt.ms\/\">jwt.ms<\/a>. \u041e\u043a\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u043e\u0434\u043d\u0438\u043c \u0447\u0430\u0441\u043e\u043c \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Unix-%D0%B2%D1%80%D0%B5%D0%BC%D1%8F\">UNIX-time<\/a> \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445.<\/p>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u043a\u043e\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0441\u043f\u043e\u0441\u043e\u0431 \u2013 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <em>Azure.Core.TokenCredential<\/em> \u0438 \u0435\u0433\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 <em>Azure.Identity.ClientSecretCredential<\/em>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/p>\n<pre><code>using Azure.Core; using Azure.Identity; using System.Net.Http.Headers;  namespace Dataverse.Habr.Intro;  public static class AuthProvider {     public static AuthenticationHeaderValue GetAuthHeader(         string tenantId,         string clientId,         string clientSecret,         string scope)     {         var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);         var tokenRequestContext = new TokenRequestContext(new[] { scope + \".default\" });         var accessToken = clientSecretCredential.GetToken(tokenRequestContext, CancellationToken.None);         return new AuthenticationHeaderValue(\"Bearer\", accessToken.Token);     } } <\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>tenantId<\/p>\n<\/td>\n<td>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 AD<\/p>\n<p>(\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438)<\/p>\n<\/td>\n<td>\n<p>835d8b21-b31c-45e8-b0a6-cea337ec6d37<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>clientId<\/p>\n<\/td>\n<td>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432 Dataverse<\/p>\n<\/td>\n<td>\n<p>8b441c8c-2cc1-405c-bf35-6cbdb1204c6d<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>clientSecret<\/p>\n<\/td>\n<td>\n<p>\u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p>4.T5a~RD7t2WpJDklI6vk003F9~FW4m3odpf<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>scope<\/p>\n<\/td>\n<td>\n<p>\u0420\u0435\u0441\u0443\u0440\u0441, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0435   \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u0449\u0443\u044e   (<em>\/.default<\/em>)<\/p>\n<\/td>\n<td>\n<p>https:\/\/your-project-development.api.crm.dynamics.com\/<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>AccessToken<\/em> \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 DateTimeOffset <em>ExpiresOn<\/em> \u0438 string <em>Token<\/em>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u043e\u0441\u0442\u0443\u043f \u043a Dataverse, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0438\u043b\u044b \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u044b. \u041d\u0435\u0442. \u041d\u0435 \u043c\u043e\u0436\u0435\u043c. \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 Dataverse. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f code-free \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043e\u0431\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c.<\/p>\n<h2>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (EntitySetName)<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c (\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c) \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445. \u041c\u044b \u0432\u0438\u0434\u0438\u043c 4 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b (Display name, Plural name, Schema name, Logical name).<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0445 <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/entity-metadata\">\u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435<\/a>. \u0412\u043e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u0418\u043c\u044f<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Display name<\/p>\n<\/td>\n<td>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435<\/p>\n<\/td>\n<td>\n<p>My Table<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Logical name <\/p>\n<\/td>\n<td>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 Display name \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f   \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Logical name \u0431\u0443\u0434\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0437\u0435 \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u0441\u0445\u0435\u043c\u044b. \u041e\u043d\u043e   \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/td>\n<td>\n<p>mysch_mytable<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Schema name<\/p>\n<\/td>\n<td>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 Logical name \u0438   \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Pascal case<\/p>\n<\/td>\n<td>\n<p>mysch_MyTable<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Entity set name (\u0441\u043c.   Logical collection name \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438)<\/p>\n<\/td>\n<td>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 Logical name \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c   \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a Web API Dataverse<\/p>\n<\/td>\n<td>\n<p>mysch_mytables<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. \u041d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <s>\u0438\u043c\u0435\u043d\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/s> <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/understand-terminology\">\u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438<\/a> \u2013 \u044d\u0442\u043e <em>Entity set name,<\/em> \u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Power Apps. \u041d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<pre><code>curl https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.2 -H \"Authorization: Bearer eyJ0eXAiOiJ\u2026\"<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code>{   \"@odata.context\": \"https:\/\/your-project-development.api.crm.dynamics.com\/api\/data\/v9.0\/$metadata\",   \"value\": [     ...     , {       \"name\": \"mysch_mytables\",       \"kind\": \"EntitySet\",       \"url\": \"mysch_mytables\"     },     ...   ] } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0435 \u0432\u044b, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0432\u044b\u0448\u0435, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.<\/p>\n<h2>\u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f<\/h2>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>curl<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-329821","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/329821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=329821"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/329821\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=329821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=329821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=329821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}