{"id":44882,"date":"2026-06-10T17:35:08","date_gmt":"2026-06-10T12:05:08","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=44882"},"modified":"2026-06-10T17:35:08","modified_gmt":"2026-06-10T12:05:08","slug":"how-to-perform-crud-operations-in-microsoft-dataverse-with-python-part-ii","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2026\/06\/how-to-perform-crud-operations-in-microsoft-dataverse-with-python-part-ii\/","title":{"rendered":"How to Perform CRUD Operations in Microsoft Dataverse with Python &#8211; Part II"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone size-full wp-image-44889\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1.png\" alt=\"CRUD Operations \" width=\"2100\" height=\"1200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1.png 2100w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1-300x171.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1-1024x585.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1-768x439.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1-1536x878.png 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1-2048x1170.png 2048w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/How-to-Perform-CRUD-Operations-in-Microsoft-Dataverse-with-Python-Part-II-1-660x377.png 660w\" sizes=\"(max-width: 2100px) 100vw, 2100px\" \/><\/p>\n<p>In modern enterprise applications, integrating external systems with Microsoft Dataverse has become increasingly common for automation, analytics, AI-driven workflows, and scalable CRM integration.<\/p>\n<p>In the <a href=\"https:\/\/www.inogic.com\/blog\/2026\/05\/how-to-perform-crud-operations-in-microsoft-dataverse-with-python\/\" target=\"_blank\" rel=\"noopener\">previous blog<\/a>, we demonstrated how to <a href=\"https:\/\/www.inogic.com\/blog\/2026\/05\/how-to-perform-crud-operations-in-microsoft-dataverse-with-python\/\" target=\"_blank\" rel=\"noopener\">perform CRUD operations<\/a> in Microsoft Dataverse using Python with MSAL authentication, Dataverse Web API, and manual HTTP request handling. This approach required developers to manually construct requests and manage API communication logic.<\/p>\n<p>In the recent blog, we used the Microsoft Dataverse Python SDK PowerPlatform<strong>-Dataverse-Client<\/strong>, which still works on top of Dataverse Web APIs but provides inbuilt Web API functions in Python. This reduces manual effort and makes CRUD operations simpler, cleaner, and more maintainable.<\/p>\n<p>Please find below steps to perform CRUD operations using above:<br \/>\n<strong><br \/>\nStep 1: Create App registration on azure portal<\/strong><\/p>\n<p>Please redirect to <a href=\"https:\/\/portal.azure.com\/\" target=\"_blank\" rel=\"noopener\">Azure Portal<\/a><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-44883\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1.jpg\" alt=\"CRUD Operations \" width=\"1920\" height=\"892\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1.jpg 1920w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1-300x139.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1-1024x476.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1-768x357.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1-1536x714.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-1-660x307.jpg 660w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p><strong>Step 2: Configure API Permission to create azure app<\/strong><\/p>\n<p>Go to API Permissions &gt; Add Permissions &gt; API my organization uses tab<\/p>\n<p>Add Permission: Dynamic CRM &gt; select User Impersonation &gt; Grand Admin Consent<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-44884\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2.jpg\" alt=\"CRUD Operations \" width=\"1919\" height=\"884\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2.jpg 1919w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2-300x138.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2-1024x472.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2-768x354.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2-1536x708.jpg 1536w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-2-660x304.jpg 660w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p><strong>\u00a0<\/strong><strong>Step 3: Import Library from Power Platform Dataverse Client and Azure identity<\/strong><\/p>\n<p><strong>pip install PowerPlatform-Dataverse-Client<\/strong><\/p>\n<p><strong>Import packages<\/strong><\/p>\n<pre class=\"lang:css gutter:true start:1\">from azure.identity import InteractiveBrowserCredential\r\n\r\nfrom PowerPlatform.Dataverse.client import DataverseClient<\/pre>\n<p>Python Code:<\/p>\n<pre class=\"lang:css gutter:true start:1\"># CONFIGURATION\r\n\r\nCLIENT_ID = \"Your Client ID\"\r\n\r\nTENANT_ID = \"Your Tenant ID\"\r\n\r\nBASE_URL = \"Crm Base URL\"\r\n\r\nEMPLOYEE_TABLE = \"Table\"\r\n\r\n# AUTHENTICATION\r\n\r\nprint(\"? Connecting to Dataverse...\")\r\n\r\ncredential = InteractiveBrowserCredential(\r\n\r\ntenant_id=TENANT_ID,\r\n\r\nclient_id=CLIENT_ID\r\n\r\n)\r\n\r\nclient = DataverseClient(BASE_URL, credential)\r\n\r\nprint(\" Connection Successful\")<\/pre>\n<p><strong>Step 4: Create Record Using Python<\/strong><\/p>\n<pre class=\"lang:css gutter:true start:1\">def create_employee():\r\n\r\nprint(\"\\nCreating Employee...\")\r\n\r\ndata = {\r\n\r\n\"ale_name\": \"Jordan Root\",\r\n\r\n\"ale_email\": \"root@company.com\",\r\n\r\n\"ale_department\": \"IT\",\r\n\r\n\"ale_salary\": 80000\r\n\r\n}\r\n\r\nresult = client.records.create(EMPLOYEE_TABLE, data)\r\n\r\nprint(\"Employee Created\")\r\n\r\nprint(\"Response:\", result)\r\n\r\nreturn result<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-44885\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-3.jpg\" alt=\"CRUD Operations \" width=\"1195\" height=\"728\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-3.jpg 1195w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-3-300x183.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-3-1024x624.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-3-768x468.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-3-660x402.jpg 660w\" sizes=\"(max-width: 1195px) 100vw, 1195px\" \/><\/p>\n<p><strong>Step 5: Update the Record below is the python code and output&lt;\/strstyle=&#8221;border: 1px solid #000000; padding: 1px; margin: 1px;&#8221;ong&gt;<\/strong><\/p>\n<pre class=\"lang:css gutter:true start:1\">def update_employee(record_id):\r\n\r\nprint(\"\\n Updating Employee...\")\r\n\r\ndata = {\r\n\r\n\"ale_salary\": 95000,\r\n\r\n\"ale_department\": \"Engineering\"\r\n\r\n}\r\n\r\nclient.records.update(EMPLOYEE_TABLE,record_id,data)\r\n\r\nprint(\" Employee Updated\")<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-44886\" style=\"border: 1px solid #000000; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-4.jpg\" alt=\"CRUD Operations \" width=\"1200\" height=\"725\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-4.jpg 1200w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-4-300x181.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-4-1024x619.jpg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-4-768x464.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2026\/06\/CRUD-Operations-4-660x399.jpg 660w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p><strong>Step 6: Delete the Record below python code to delete the record<\/strong><\/p>\n<pre class=\"lang:css gutter:true start:1\">def delete_employee(record_id):\r\n\r\nprint(\"\\n Deleting Employee...\")\r\n\r\nclient.records.delete(EMPLOYEE_TABLE,record_id)\r\n\r\nprint(\" Employee Deleted\")<\/pre>\n<h3><strong>Conclusion:<\/strong><\/h3>\n<p>The Microsoft Dataverse SDK for Python provides a modern and simplified approach for integrating Python applications with Microsoft Dataverse.<\/p>\n<p>Compared to the traditional Web API implementation, the SDK reduces manual coding efforts by abstracting authentication, request handling, endpoint management, and CRUD operations into reusable methods.<\/p>\n<p>This result is cleaner code structure, better maintainability, reduced development complexity, easier enterprise scalability, faster implementation.<\/p>\n<p>The SDK is especially useful for enterprise developers, data scientists, and AI application developers who want to build intelligent and scalable business solutions on top of Dataverse using Python.<\/p>\n<h3><strong>Frequently Asked Questions (FAQs)<br \/>\n<\/strong><\/h3>\n<h4><strong>1. What is the Microsoft Dataverse Python SDK?<\/strong><\/h4>\n<p>The Microsoft Dataverse Python SDK (PowerPlatform-Dataverse-Client) is a Python library that simplifies interactions with Microsoft Dataverse. It provides built-in methods for authentication, record management, and CRUD operations, eliminating the need to manually construct HTTP requests and Web API calls.<\/p>\n<h4><strong>2. How do I perform CRUD operations in Microsoft Dataverse using Python?<\/strong><\/h4>\n<p>You can perform CRUD (Create, Read, Update, and Delete) operations in Microsoft Dataverse using the PowerPlatform-Dataverse-Client library. After authenticating with Azure Active Directory, you can use built-in SDK methods such as create(), retrieve(), update(), and delete() to manage Dataverse records.<\/p>\n<h4><strong>3. What are the prerequisites for connecting Python to Microsoft Dataverse?<\/strong><\/h4>\n<p>Before connecting Python to Dataverse, you need:<\/p>\n<ul>\n<li>An active Microsoft Dataverse environment<\/li>\n<li>An Azure App Registration<\/li>\n<li>Appropriate Dataverse API permissions<\/li>\n<li>Client ID and Tenant ID<\/li>\n<li>The PowerPlatform-Dataverse-Client and Azure Identity libraries installed in Python<\/li>\n<\/ul>\n<h4><strong>4. Why use the Dataverse Python SDK instead of direct Web API calls?<\/strong><\/h4>\n<p>The Dataverse Python SDK reduces development complexity by handling authentication, request construction, endpoint management, and API communication internally. This results in cleaner code, faster development, easier maintenance, and improved scalability compared to manually using Dataverse Web APIs.<br \/>\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"What is the Microsoft Dataverse Python SDK?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The Microsoft Dataverse Python SDK (PowerPlatform-Dataverse-Client) is a Python library that simplifies interactions with Microsoft Dataverse. It provides built-in methods for authentication, record management, and CRUD operations, eliminating the need to manually construct HTTP requests and Web API calls.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do I perform CRUD operations in Microsoft Dataverse using Python?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"You can perform CRUD (Create, Read, Update, and Delete) operations in Microsoft Dataverse using the PowerPlatform-Dataverse-Client library. After authenticating with Azure Active Directory, you can use built-in SDK methods such as create(), retrieve(), update(), and delete() to manage Dataverse records.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What are the prerequisites for connecting Python to Microsoft Dataverse?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Before connecting Python to Dataverse, you need:<\/p>\n<p>An active Microsoft Dataverse environment\nAn Azure App Registration\nAppropriate Dataverse API permissions\nClient ID and Tenant ID\nThe PowerPlatform-Dataverse-Client and Azure Identity libraries installed in Python\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"Why use the Dataverse Python SDK instead of direct Web API calls?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The Dataverse Python SDK reduces development complexity by handling authentication, request construction, endpoint management, and API communication internally. This results in cleaner code, faster development, easier maintenance, and improved scalability compared to manually using Dataverse Web APIs.\"\n    }\n  }]\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In modern enterprise applications, integrating external systems with Microsoft Dataverse has become increasingly common for automation, analytics, AI-driven workflows, and scalable CRM integration. In the previous blog, we demonstrated how to perform CRUD operations in Microsoft Dataverse using Python with MSAL authentication, Dataverse Web API, and manual HTTP request handling. This approach required developers to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2026\/06\/how-to-perform-crud-operations-in-microsoft-dataverse-with-python-part-ii\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2354,2361],"tags":[2328],"class_list":["post-44882","post","type-post","status-publish","format-standard","hentry","category-dataverse","category-technical","tag-crud-operations"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/44882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=44882"}],"version-history":[{"count":2,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/44882\/revisions"}],"predecessor-version":[{"id":44890,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/44882\/revisions\/44890"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=44882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=44882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=44882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}