{"id":492,"date":"2024-08-01T14:23:31","date_gmt":"2024-08-01T04:23:31","guid":{"rendered":"https:\/\/www.cloudproinc.com.au\/?p=492"},"modified":"2024-08-01T14:32:52","modified_gmt":"2024-08-01T04:32:52","slug":"automating-access-to-microsoft-graph-api-using-azure-pipelines","status":"publish","type":"post","link":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/","title":{"rendered":"Automating Access to Microsoft Graph API Using Azure Pipelines"},"content":{"rendered":"\n<p>This Azure DevOps pipelines article will show how we automate access to Microsoft Graph API using Azure DevOps pipelines. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Azure pipelines is an Azure DevOps service that allows us to automate the deployment of applications, services and changes to cloud environments. <\/p>\n\n\n\n<p>Microsoft Graph API is the underlining API service that allows us to interact programmatically with every Microsoft 365, <a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/25\/assigning-local-admins-to-windows-11-through-intune\/\">Intune<\/a>, Entra ID, and Power Automate service using C#, JavaScript, Python, PHP, Java, Go, Azure CLI, and PowerShell. <\/p>\n\n\n\n<p>To connect the two services, we need to create a service connection inside an Azure DevOps project. The service connection will use a managed identity. An Azure-managed identity is like a service principal without the need to manage and rotate secrets and certificates. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-create-a-service-connection\">Create a Service Connection<\/h2>\n\n\n\n<p>To create a service connection, Open an Azure DevOps project, click on Settings, and select Service Connections from the list. Then, click Create <strong>Service connection<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"601\" data-src=\"\/wp-content\/uploads\/2024\/08\/image-8-1024x601.png\" alt=\"\" class=\"wp-image-505 lazyload\" data-srcset=\"\/wp-content\/uploads\/2024\/08\/image-8-1024x601.png 1024w, \/wp-content\/uploads\/2024\/08\/image-8-300x176.png 300w, \/wp-content\/uploads\/2024\/08\/image-8-768x451.png 768w, \/wp-content\/uploads\/2024\/08\/image-8-1536x902.png 1536w, \/wp-content\/uploads\/2024\/08\/image-8-2048x1202.png 2048w, \/wp-content\/uploads\/2024\/08\/image-8-1080x634.png 1080w, \/wp-content\/uploads\/2024\/08\/image-8-1280x751.png 1280w, \/wp-content\/uploads\/2024\/08\/image-8-980x575.png 980w, \/wp-content\/uploads\/2024\/08\/image-8-480x282.png 480w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/601;\" \/><\/figure>\n\n\n\n<p>From the list of connections, select <strong>Azure Resource Manager<\/strong> and <strong>Workload Identity Federation (automatic)<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"727\" height=\"719\" data-src=\"\/wp-content\/uploads\/2024\/08\/image-1.png\" alt=\"\" class=\"wp-image-495 lazyload\" data-srcset=\"\/wp-content\/uploads\/2024\/08\/image-1.png 727w, \/wp-content\/uploads\/2024\/08\/image-1-300x297.png 300w, \/wp-content\/uploads\/2024\/08\/image-1-480x475.png 480w\" data-sizes=\"(max-width: 727px) 100vw, 727px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 727px; --smush-placeholder-aspect-ratio: 727\/719;\" \/><\/figure>\n\n\n\n<p>From the connection configuration page, select your Azure subscription details, Resource Group, and name, then save the connection.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"730\" height=\"1020\" data-src=\"\/wp-content\/uploads\/2024\/08\/image-2.png\" alt=\"\" class=\"wp-image-496 lazyload\" data-srcset=\"\/wp-content\/uploads\/2024\/08\/image-2.png 730w, \/wp-content\/uploads\/2024\/08\/image-2-215x300.png 215w, \/wp-content\/uploads\/2024\/08\/image-2-480x671.png 480w\" data-sizes=\"(max-width: 730px) 100vw, 730px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 730px; --smush-placeholder-aspect-ratio: 730\/1020;\" \/><\/figure>\n\n\n\n<p>Next, we need to assign the Managed-Identity account API permissions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-grant-graph-api-permissions\">Grant Graph API permissions <\/h2>\n\n\n\n<p>To grant the newly created Managed-Identity account access to manage resources in Entra or other Microsoft 365 services. we need to grant it API permissions. <\/p>\n\n\n\n<p>Open the Entra console and search for the newly created Managed-Itentiy. the name will include the Azure DevOps organisation name, project name and object ID. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"628\" height=\"183\" data-src=\"\/wp-content\/uploads\/2024\/08\/image-4.png\" alt=\"\" class=\"wp-image-498 lazyload\" data-srcset=\"\/wp-content\/uploads\/2024\/08\/image-4.png 628w, \/wp-content\/uploads\/2024\/08\/image-4-300x87.png 300w, \/wp-content\/uploads\/2024\/08\/image-4-480x140.png 480w\" data-sizes=\"(max-width: 628px) 100vw, 628px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 628px; --smush-placeholder-aspect-ratio: 628\/183;\" \/><\/figure>\n\n\n\n<p>After you locate the new identity, click on it and select <strong>API Permissions<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"753\" data-src=\"\/wp-content\/uploads\/2024\/08\/image-6-1024x753.png\" alt=\"\" class=\"wp-image-500 lazyload\" data-srcset=\"\/wp-content\/uploads\/2024\/08\/image-6-1024x753.png 1024w, \/wp-content\/uploads\/2024\/08\/image-6-300x221.png 300w, \/wp-content\/uploads\/2024\/08\/image-6-768x565.png 768w, \/wp-content\/uploads\/2024\/08\/image-6-1080x794.png 1080w, \/wp-content\/uploads\/2024\/08\/image-6-980x721.png 980w, \/wp-content\/uploads\/2024\/08\/image-6-480x353.png 480w, \/wp-content\/uploads\/2024\/08\/image-6.png 1199w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/753;\" \/><\/figure>\n\n\n\n<p>Click on Add a permission and add all the Application permissions that are needed.  <\/p>\n\n\n\n<p>Note: Make sure you use Application and not Delegated permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"272\" data-src=\"\/wp-content\/uploads\/2024\/08\/image-7-1024x272.png\" alt=\"\" class=\"wp-image-501 lazyload\" data-srcset=\"\/wp-content\/uploads\/2024\/08\/image-7-1024x272.png 1024w, \/wp-content\/uploads\/2024\/08\/image-7-300x80.png 300w, \/wp-content\/uploads\/2024\/08\/image-7-768x204.png 768w, \/wp-content\/uploads\/2024\/08\/image-7-1536x409.png 1536w, \/wp-content\/uploads\/2024\/08\/image-7-1080x287.png 1080w, \/wp-content\/uploads\/2024\/08\/image-7-1280x341.png 1280w, \/wp-content\/uploads\/2024\/08\/image-7-980x261.png 980w, \/wp-content\/uploads\/2024\/08\/image-7-480x128.png 480w, \/wp-content\/uploads\/2024\/08\/image-7.png 1654w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/272;\" \/><\/figure>\n\n\n\n<p>After completing this step, we can move to the final step and connect to Graph API from an Azure pipeline.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-automating-access-to-microsoft-graph-api-using-azure-pipelines\">Automating Access to Microsoft Graph API Using Azure Pipelines<\/h2>\n\n\n\n<p>The final step will be connecting and using Graph API from an Azure Pipeline. In the following example, I use Azure PowerShell to request an access token and the Graph API Powershell module to run Graph API calls. <\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-00e8788181975a63c83b1c86c19fbeb8\"><code>trigger:\n- none\n \npool:\n  vmImage: ubuntu-latest\n \nsteps:\n- task: AzurePowerShell@5\n  displayName: 'Get Entra access token using Azure PowerShell'\n  inputs:\n    azureSubscription: 'YOUR-SERVICE-CONNECTION-NAME'\n    azurePowerShellVersion: LatestVersion\n    ScriptType: 'InlineScript'\n    inline: |\n      $token = Get-AzAccessToken -ResourceUrl \"https:\/\/graph.microsoft.com\"\n      $accessToken = $token.Token\n      Write-Host \"##vso&#91;task.setvariable variable=secretToken;issecret=true]$accessToken\"\n- task: PowerShell@2\n  displayName: 'Connect to Graph API using the token from the above task'\n  inputs:\n    targetType: 'inline'\n    script: |\n      # Connect to Graph API and get Entra ID user info\n      $secureToken = ConvertTo-SecureString -String $(secretToken) -AsPlainText\n      Install-Module Microsoft.Graph.Authentication\n      Install-Module Microsoft.Graph.Users\n      Connect-MgGraph -AccessToken $secureToken\n      Get-MgUser -UserId \"some upn\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-more-articles\">More articles <\/h2>\n\n\n\n<ul class=\"wp-block-yoast-seo-related-links yoast-seo-related-links\">\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/23\/how-to-use-microsoft-graph-security-api\/\">How to Use Microsoft Graph Security API<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/29\/setting-up-email-to-case-in-dynamics-365\/\">Setting Up Email to Case in Dynamics 365<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/29\/streamlining-entra-id-app-registrations-with-azure-bicep\/\">Streamlining Entra ID App Registrations with Azure Bicep<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2022\/02\/23\/five-ways-to-secure-your-microsoft-365-tenant-tips-to-keep-your-data-safe\/\">Five Ways to Secure Your Microsoft 365 Tenant: Tips to Keep Your Data Safe<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/11\/list-classic-azure-administrators-using-powershell-and-azure-rest-api\/\">List Classic Azure Administrators Using PowerShell and Azure REST API<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.ntweekly.com\/2024\/02\/01\/connect-to-microsoft-graph-from-a-net-application\/\">Connect to Microsoft Graph from a .NET Application<\/a><\/li>\n<\/ul>\n\n\n\n<p>If your organisation needs assistance with Microsoft Graph API development and automation, contact us using the form below.<\/p>\n\n\n<div class=\"wp-block-jetpack-contact-form is-layout-flex wp-container-jetpack-contact-form-is-layout-026b38f8 wp-block-jetpack-contact-form-is-layout-flex\"><a href=\"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/\" target=\"_blank\" rel=\"noopener noreferrer\">Submit a form.<\/a><\/div>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Azure DevOps pipelines article will show how we automate access to Microsoft Graph API using Azure DevOps pipelines.<\/p>\n","protected":false},"author":1,"featured_media":493,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"Automating Access to Microsoft Graph API Using Azure Pipelines","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":"","_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[42,41,43,13,40],"tags":[],"class_list":["post-492","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-devops","category-azure-managed-identity","category-azure-pipelines","category-blog","category-graph-api"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Automating Access to Microsoft Graph API Using Azure Pipelines - CPI Consulting<\/title>\n<meta name=\"description\" content=\"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Access to Microsoft Graph API Using Azure Pipelines\" \/>\n<meta property=\"og:description\" content=\"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/\" \/>\n<meta property=\"og:site_name\" content=\"CPI Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-01T04:23:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-01T04:32:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudproinc.com.au\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1792\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"CPI Staff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CPI Staff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/\"},\"author\":{\"name\":\"CPI Staff\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\"},\"headline\":\"Automating Access to Microsoft Graph API Using Azure Pipelines\",\"datePublished\":\"2024-08-01T04:23:31+00:00\",\"dateModified\":\"2024-08-01T04:32:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/\"},\"wordCount\":429,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp\",\"articleSection\":[\"Azure devOps\",\"Azure Managed-Identity\",\"Azure Pipelines\",\"Blog\",\"Graph API\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/\",\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/\",\"name\":\"Automating Access to Microsoft Graph API Using Azure Pipelines - CPI Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp\",\"datePublished\":\"2024-08-01T04:23:31+00:00\",\"dateModified\":\"2024-08-01T04:32:52+00:00\",\"description\":\"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#primaryimage\",\"url\":\"\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp\",\"width\":1792,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/2024\\\/08\\\/01\\\/automating-access-to-microsoft-graph-api-using-azure-pipelines\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Access to Microsoft Graph API Using Azure Pipelines\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#website\",\"url\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/\",\"name\":\"Cloud Pro Inc - CPI Consulting Pty Ltd\",\"description\":\"Cloud, AI &amp; Cybersecurity Consulting | Melbourne\",\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#organization\",\"name\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\",\"url\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"width\":500,\"height\":500,\"caption\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cloudproinc.azurewebsites.net\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\",\"name\":\"CPI Staff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"caption\":\"CPI Staff\"},\"sameAs\":[\"http:\\\/\\\/www.cloudproinc.com.au\"],\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/author\\\/cpiadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Automating Access to Microsoft Graph API Using Azure Pipelines - CPI Consulting","description":"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/","og_locale":"en_US","og_type":"article","og_title":"Automating Access to Microsoft Graph API Using Azure Pipelines","og_description":"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.","og_url":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/","og_site_name":"CPI Consulting","article_published_time":"2024-08-01T04:23:31+00:00","article_modified_time":"2024-08-01T04:32:52+00:00","og_image":[{"width":1792,"height":1024,"url":"https:\/\/cloudproinc.com.au\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","type":"image\/webp"}],"author":"CPI Staff","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CPI Staff","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#article","isPartOf":{"@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/"},"author":{"name":"CPI Staff","@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e"},"headline":"Automating Access to Microsoft Graph API Using Azure Pipelines","datePublished":"2024-08-01T04:23:31+00:00","dateModified":"2024-08-01T04:32:52+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/"},"wordCount":429,"commentCount":1,"publisher":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#organization"},"image":{"@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","articleSection":["Azure devOps","Azure Managed-Identity","Azure Pipelines","Blog","Graph API"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/","url":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/","name":"Automating Access to Microsoft Graph API Using Azure Pipelines - CPI Consulting","isPartOf":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#primaryimage"},"image":{"@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","datePublished":"2024-08-01T04:23:31+00:00","dateModified":"2024-08-01T04:32:52+00:00","description":"Unlock the power of automation with Azure Pipelines. Automate access to Microsoft Graph API for seamless integration with Azure DevOps.","breadcrumb":{"@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#primaryimage","url":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","contentUrl":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","width":1792,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudproinc.azurewebsites.net\/"},{"@type":"ListItem","position":2,"name":"Automating Access to Microsoft Graph API Using Azure Pipelines"}]},{"@type":"WebSite","@id":"https:\/\/cloudproinc.azurewebsites.net\/#website","url":"https:\/\/cloudproinc.azurewebsites.net\/","name":"Cloud Pro Inc - CPI Consulting Pty Ltd","description":"Cloud, AI &amp; Cybersecurity Consulting | Melbourne","publisher":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudproinc.azurewebsites.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudproinc.azurewebsites.net\/#organization","name":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd","url":"https:\/\/cloudproinc.azurewebsites.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","contentUrl":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","width":500,"height":500,"caption":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd"},"image":{"@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudproinc.azurewebsites.net\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e","name":"CPI Staff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","caption":"CPI Staff"},"sameAs":["http:\/\/www.cloudproinc.com.au"],"url":"https:\/\/cloudproinc.com.au\/index.php\/author\/cpiadmin\/"}]}},"jetpack_featured_media_url":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","jetpack-related-posts":[{"id":53079,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/01\/28\/running-c-net-applications-in-azure-devops-pipelines\/","url_meta":{"origin":492,"position":0},"title":"Running C# .NET Applications in Azure DevOps Pipelines","author":"CPI Staff","date":"January 28, 2025","format":false,"excerpt":"In this blog post, I will show you how to build and run a C# application in Azure DevOps Pipelines. Estimated reading time: 3 minutes Table of contentsWhat Are Azure Pipelines?Step 1: Build the Console ApplicationStep 2: Create a YAML PipelineStep 3: Create a New PipelinePipeline Execution OverviewSummaryRelated Articles What\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/01\/Running-C-.NET-Applications-in-Azure-DevOps-Pipelines.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/01\/Running-C-.NET-Applications-in-Azure-DevOps-Pipelines.webp 1x, \/wp-content\/uploads\/2025\/01\/Running-C-.NET-Applications-in-Azure-DevOps-Pipelines.webp 1.5x, \/wp-content\/uploads\/2025\/01\/Running-C-.NET-Applications-in-Azure-DevOps-Pipelines.webp 2x"},"classes":[]},{"id":584,"url":"https:\/\/cloudproinc.com.au\/index.php\/2024\/08\/28\/deploy-azure-resources-with-logic-apps\/","url_meta":{"origin":492,"position":1},"title":"Deploy Azure Resources With Logic Apps","author":"CPI Staff","date":"August 28, 2024","format":false,"excerpt":"This Microsoft Azure post will show how to deploy Azure resources with Logic Apps. Table of contentsDeploy Azure Resources With Logic AppsAzure Rest APICreate a Logic AppRelated Articles Azure Logic App is a cloud service that allows us to create workflows and automation tasks similar to Power Automate in Microsoft\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/07\/How-to-Recover-Deleted-or-Lost-Exchange-Online-Emails-to-PST.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/07\/How-to-Recover-Deleted-or-Lost-Exchange-Online-Emails-to-PST.webp 1x, \/wp-content\/uploads\/2024\/07\/How-to-Recover-Deleted-or-Lost-Exchange-Online-Emails-to-PST.webp 1.5x, \/wp-content\/uploads\/2024\/07\/How-to-Recover-Deleted-or-Lost-Exchange-Online-Emails-to-PST.webp 2x, \/wp-content\/uploads\/2024\/07\/How-to-Recover-Deleted-or-Lost-Exchange-Online-Emails-to-PST.webp 3x, \/wp-content\/uploads\/2024\/07\/How-to-Recover-Deleted-or-Lost-Exchange-Online-Emails-to-PST.webp 4x"},"classes":[]},{"id":739,"url":"https:\/\/cloudproinc.com.au\/index.php\/2024\/10\/07\/creating-a-text-to-speech-power-app-using-openai-whisper\/","url_meta":{"origin":492,"position":2},"title":"Creating a Text-to-Speech Power App Using OpenAI Whisper","author":"CPI Staff","date":"October 7, 2024","format":false,"excerpt":"In this post on OpenAI and Microsoft Power Apps, we will create a Text-to-Speech Power App using OpenAI Whisper. Table of contentsCreating a Text-to-Speech Power App Using OpenAI WhisperGet an API Key from OpenAICreating a Text-to-Speech Power AppCreate Power Automate FlowRelated Articles OpenAI whisper is OpenAI's Text-to-Speech service, offering human-like\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 1x, \/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 1.5x, \/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 2x"},"classes":[]},{"id":53463,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/07\/08\/how-to-authenticate-to-azure-cli-with-a-service-principal\/","url_meta":{"origin":492,"position":3},"title":"How to Authenticate to Azure CLI with a Service Principal","author":"CPI Staff","date":"July 8, 2025","format":false,"excerpt":"In this blog post, we'll show you how to authenticate to Azure CLI with a Service Principal and login to Azure. Azure CLI is a command-line utility written in Python that allows users to manage Azure resources programmatically. It is widely used by DevOps engineers, developers, and IT professionals to\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 1x, \/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 1.5x, \/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 2x"},"classes":[]},{"id":53585,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/","url_meta":{"origin":492,"position":4},"title":"Use Azure Managed Identity with Azure Automation PowerShell","author":"CPI Staff","date":"August 8, 2025","format":false,"excerpt":"When running scripts in Azure Automation, authentication is often the trickiest part. Your runbooks might need to connect to Azure services, Microsoft Graph, or other APIs \u2014 and that means handling credentials securely. In this guide, Use Azure Managed Identity with Azure Automation PowerShell, we\u2019ll focus specifically on User-assigned Managed\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png 1x, \/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png 1.5x, \/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png 2x"},"classes":[]},{"id":53428,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/06\/30\/run-azure-powershell-cmdlets-using-docker-containers\/","url_meta":{"origin":492,"position":5},"title":"Run Azure PowerShell cmdlets using Docker Containers","author":"CPI Staff","date":"June 30, 2025","format":false,"excerpt":"In this blog post, we\u2019ll show you how to run Azure PowerShell cmdlets using Docker containers. Table of contentsPrerequisitesPull the Azure PowerShell Docker ImageRun the Container and Connect to AzureRunning Scripts from Your Local Machine Azure PowerShell provides a familiar PowerShell interface to manage Azure resources and infrastructure. It enables\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 1x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 1.5x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 2x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 3x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=492"}],"version-history":[{"count":3,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/492\/revisions"}],"predecessor-version":[{"id":506,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/492\/revisions\/506"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media\/493"}],"wp:attachment":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}