{"id":375,"date":"2019-09-29T09:44:02","date_gmt":"2019-09-29T16:44:02","guid":{"rendered":"http:\/\/blog.nillsf.com\/?p=375"},"modified":"2019-09-29T09:44:02","modified_gmt":"2019-09-29T16:44:02","slug":"how-to-allow-users-to-create-service-principals-and-the-impact-on-managed-identity","status":"publish","type":"post","link":"https:\/\/blog.nillsf.com\/index.php\/2019\/09\/29\/how-to-allow-users-to-create-service-principals-and-the-impact-on-managed-identity\/","title":{"rendered":"How to allow users to create service principals and the impact on Managed Identity"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A common question I get from customers is how they can enable their development teams to create service principals. In this post, I&#8217;ll explain how you can achieve this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll finish the post by exploring the impact on Managed Identities as well. During the writing of the Managed Identities piece, I hit something I hadn&#8217;t expected, so we&#8217;ll explore that topic in quiet some depth.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What exactly is a Service Principal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before we dive into this, let&#8217;s focus on the semantics of the discussion, namely, what exactly is a service principal? The most easy definition of a service principal is that is an account an application will use to authenticate to Azure AD. It is similar to what a service account is in regular AD Domain Services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One level of confusion in terminology, is that when you go into the Azure AD portal to configure a service principal, you&#8217;ll actually go into the &#8216;App registrations&#8217; pane. So, another question is, what is the difference between an Application and a Service Principal? The answer is provided in detail in the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/app-objects-and-service-principals#application-and-service-principal-relationship\">Microsoft Documentation<\/a>, but for a quick reply:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>An <strong>application<\/strong> is the representation of an application across all potential tenants of that application.<\/li><li>A <strong>service principal<\/strong> is the representation of that application specifically in your Azure AD tenant.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In other words, an application will have 1 service principal for each Azure AD tenant it is used in. If you only have 1 tenant, both terms can be used interchangeably.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, how can I allow users to create service principals without giving too many access rights?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Option 1: Allow everyone to create Service Principals<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first option &#8211; and the easiest option &#8211; is to give everyone in your organization the ability to create service principals. There is a toggle in the Azure AD configuration that enables you to allow everyone to create service principals.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before we dive into the configuration, let&#8217;s think about what this means. Having the toggle activated, means everyone in your organization (everyone who has a login into Azure AD) can create Service Principals. This means, everyone can make an application, than can authenticate to your Azure AD instance. That&#8217;s just authentication, that has nothing to do with what those application <em>can<\/em> do. There&#8217;s a <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/active-directory-how-applications-are-added#who-has-permission-to-add-applications-to-my-azure-ad-instance\">section of the Microsoft documentation<\/a> that describes these permissions, and why it is not a bad idea to enable people to register application objects. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you head on over to the <a href=\"https:\/\/portal.azure.com\/#blade\/Microsoft_AAD_IAM\/ActiveDirectoryMenuBlade\/Overview\">Azure AD section<\/a> of the azure portal, there&#8217;s a blade called <a href=\"https:\/\/portal.azure.com\/#blade\/Microsoft_AAD_IAM\/ActiveDirectoryMenuBlade\/UserSettings\">user settings<\/a>. This blade contains the option to enable users to create app registrations (aka service principals)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"249\" height=\"84\" src=\"\/wp-content\/uploads\/2019\/09\/image-47.png\" alt=\"\" class=\"wp-image-376\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you enable this option, all users will be able to create service principals. If you disable this, only certain administrators will be able to create service principals. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To demonstrate (and test) this, I&#8217;ll be using a fictional user called Ben in my own personal AAD tenant, who has no administrative role assigned to him &#8211; while this toggle is set to &#8216;Yes&#8217;.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"198\" src=\"\/wp-content\/uploads\/2019\/09\/image-48.png\" alt=\"\" class=\"wp-image-377\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-48.png 657w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-48-300x90.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"499\" height=\"228\" src=\"\/wp-content\/uploads\/2019\/09\/image-49.png\" alt=\"\" class=\"wp-image-378\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-49.png 499w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-49-300x137.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">With the toggle set to &#8216;Yes&#8217;, I can login as Ben, head-on over to App registrations blade and go ahead and create a new service principal:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"403\" src=\"\/wp-content\/uploads\/2019\/09\/image-50.png\" alt=\"\" class=\"wp-image-379\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-50.png 492w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-50-300x246.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If I now change this toggle to &#8216;No&#8217; &#8211; I should no longer be able to create service principals. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Disclaimer: Changing the toggle actually works and limits the ability to create new Service Principals. In my case however, it did take a while for this new setting to become &#8216;active&#8217;. I didn&#8217;t exactly time how long it took, it didn&#8217;t work in the first 10 minutes, and then I took a dinner break and restarted the day after. Hence, no exact science from me here.<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"241\" src=\"\/wp-content\/uploads\/2019\/09\/image-51.png\" alt=\"\" class=\"wp-image-380\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-51.png 824w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-51-300x88.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-51-768x225.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So, this now disables all users from registering service principals. As I mentioned before, <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/active-directory-how-applications-are-added#who-has-permission-to-add-applications-to-my-azure-ad-instance\">the documents has arguments in favor of<\/a> allowing everyone to be able to create application registrations. If however, you decide to limit this capability, there is a second option to enable people to create service principals.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Option 2: Administrator role in Azure AD<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Azure AD has the concept of RBAC built-in. The <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-assign-admin-roles\">RBAC of Azure AD<\/a> is separate from the Azure RBAC that you apply to subscriptions and resource groups. Those are two separate control planes, with one exception: there is an option in Azure AD to would enable your Azure AD global administrator to have access to all Azure subscriptions (kind-of like a break-glass account).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"789\" height=\"439\" src=\"\/wp-content\/uploads\/2019\/09\/image-52.png\" alt=\"\" class=\"wp-image-381\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-52.png 789w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-52-300x167.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-52-768x427.png 768w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Within the Azure AD RBAC, there is one role that specifically allows certain administrators to be able to create application registrations, or service principals. This role is called the &#8220;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-assign-admin-roles#application-developer\">application developer<\/a>&#8221; role. Let&#8217;s have a look at what this would mean for our fictional Ben. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To start, we&#8217;ll login as an actual administrator in Azure AD, and give Ben the role of Application Developer. For this, we head on over to Azure AD, select the Users blade and select our user Ben. Within his blade, we can select Directory role, and add an assignment for him to become an Application Developer.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"415\" height=\"190\" src=\"\/wp-content\/uploads\/2019\/09\/image-53.png\" alt=\"\" class=\"wp-image-382\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-53.png 415w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-53-300x137.png 300w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"230\" height=\"187\" src=\"\/wp-content\/uploads\/2019\/09\/image-54.png\" alt=\"\" class=\"wp-image-383\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now that Ben is an application developer, let&#8217;s login as Ben in the Azure portal, and try registering an application (or service principal) again to see if this will work this time. And this works like a charm:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"89\" src=\"\/wp-content\/uploads\/2019\/09\/image-55.png\" alt=\"\" class=\"wp-image-384\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-55.png 487w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-55-300x55.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Disclaimer: I mentioned during option 1 that it took a while for the &#8216;no&#8217; toggle to become active. In this case, giving a person a directory role had immediate success in my case. <\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What about Managed Identities?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While I am writing this, I am thinking to myself, what is the impact on <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/managed-identities-azure-resources\/overview\">Managed Identities<\/a>? If you are unfamiliar with managed identities, let me quickly give you the highlights: Managed identities provide a mechanism for application running on Azure (either on VMs, Functions, App service or even pods in AKS) to get an identity in Azure AD. Those applications then can call an internal endpoint to get a oAuth token without having a certificate or a password. The benefit here is that you know where the application is running, and you trust that application. No need to store passwords or certificates (<em>by you, as you&#8217;ll learn later on<\/em>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A managed identity will essentially create a Service Principal for you in Azure AD. Let&#8217;s see what impact the ability to create service principals has on the ability to create managed identities. My assumption is that:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Assumption 1<\/strong>: As long as Ben has to ability to create service principals, he&#8217;ll be able to create managed identities.<\/li><li><strong>Assumption 2<\/strong>: If he doesn&#8217;t have the right to create service principals, he won&#8217;t be able to create those managed identities.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s verify my assumptions. To do this, I&#8217;ll first give Ben access to my Azure subscription, using Azure RBAC. To do this, I&#8217;ll head over to the subscription blade, and add a role assignment making Ben a owner of my subscription.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"646\" height=\"218\" src=\"\/wp-content\/uploads\/2019\/09\/image-56.png\" alt=\"\" class=\"wp-image-385\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-56.png 646w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-56-300x101.png 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s log in as Ben &#8211; while he is still an application developer in Azure AD &#8211; and have him try to create a managed identity. For this, we&#8217;ll open the<a href=\"https:\/\/portal.azure.com\/#blade\/HubsExtension\/BrowseResourceBlade\/resourceType\/Microsoft.ManagedIdentity%2FuserAssignedIdentities\"> Managed Identities blade<\/a>, and create a new one. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"397\" height=\"137\" src=\"\/wp-content\/uploads\/2019\/09\/image-57.png\" alt=\"\" class=\"wp-image-386\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-57.png 397w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-57-300x104.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">While Ben was an Application Developer in Azure AD, he could create Managed Identities. Proof is this I_am_dev identity:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"232\" src=\"\/wp-content\/uploads\/2019\/09\/image-58.png\" alt=\"\" class=\"wp-image-387\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-58.png 528w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-58-300x132.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s now remove the Application Developer role from Ben, and see if he can still create managed identities. To check whether or not Ben can create service principals, let&#8217;s see if he can create application registrations:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"578\" src=\"\/wp-content\/uploads\/2019\/09\/image-59.png\" alt=\"\" class=\"wp-image-388\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-59.png 719w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-59-300x241.png 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So, Ben cannot create service principals. Let&#8217;s see if creating a new managed identity will also be blocked. This however, is not the case, meaning <strong>my second assumption was wrong.<\/strong> Why?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"261\" height=\"275\" src=\"\/wp-content\/uploads\/2019\/09\/image-60.png\" alt=\"\" class=\"wp-image-389\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Deep dive: Why can I create Managed Identities when I cannot create regular service principals<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s look into this: Ben does not have the ability to create application registrations, but he does have the ability to create managed identities. How can this be? <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Looking at <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/managed-identities-azure-resources\/overview#how-does-the-managed-identities-for-azure-resources-work\">the documentation<\/a> for Managed Identities. This one states:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p> Through a create process, <strong>Azure creates an identity<\/strong> in the Azure AD tenant that&#8217;s trusted by the subscription in use. <\/p><cite>Microsoft documentation<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">This would indicate to me that Azure itself will create the identity in my directory, and not actually the user that created the managed identity. Let&#8217;s have a look at the Azure AD audit logs to see what they have to say:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"137\" src=\"\/wp-content\/uploads\/2019\/09\/image-62-1024x137.png\" alt=\"\" class=\"wp-image-391\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-62-1024x137.png 1024w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-62-300x40.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-62-768x103.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-62.png 1370w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see, there are 5 logs that are relevant here, the way I interpret what happened here (reading logs from bottom to top):<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>The moment we created our first Managed Identity, the Managed Service Identity service principal gets registered in our AAD tenant.<\/li><li>Second step, we see that that Managed Service Identity service principal creates our i_am_dev application.<\/li><li>Third step, we see that we now remove the app dev role from Ben.<\/li><li>Fourth step, we see that the MSI service creates a new SP, called i_am_not_dev.<\/li><li>Fifth step, the Keyvault Certificate Rotation SP is registered to our AAD tenant, to allow the managed identity certificate rotation to happen.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">My assumption now is that the Managed Identities Ben created, won&#8217;t show up as Ben&#8217;s applications, as he didn&#8217;t actually create them. Let&#8217;s check all of Ben&#8217;s &#8216;owned applications&#8217;:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"382\" height=\"225\" src=\"\/wp-content\/uploads\/2019\/09\/image-61.png\" alt=\"\" class=\"wp-image-390\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-61.png 382w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-61-300x177.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Our managed identities (there are two now) don&#8217;t show up here. But it has to exist in our directory, shouldn&#8217;t it? Let&#8217;s use the CLI to figure out some more:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First step, let&#8217;s get a list of all our identities in our directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az ad sp list<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command gives a lot of output, let&#8217;s try to find out I_am_dev service principal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az ad sp list -o table | grep -i i_am_dev<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command will output us a single line for our I_am_dev managed identity. To get the full details of this identity, let&#8217;s copy the id of the identity (the first GUID) do a full &#8216;show&#8217; in CLI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az ad sp show --id 35fd1a11-30d0-46ec-bd39-0321298b0023<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This shows us a full json object reflecting our managed identity in Azure AD. What I found most interesting are these two parts of the JSON body:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"keyCredentials\": [\n    {\n      \"additionalProperties\": null,\n      \"customKeyIdentifier\": \"35E9F5106D89CAC9B921A22473DED87FC992CB94\",\n      \"endDate\": \"2019-12-28T15:20:00+00:00\",\n      \"keyId\": \"f63e8eaf-5d43-40cd-8287-41b9f7d6722d\",\n      \"startDate\": \"2019-09-29T15:20:00+00:00\",\n      \"type\": \"AsymmetricX509Cert\",\n      \"usage\": \"Verify\",\n      \"value\": null\n    }\n  ],<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This first part contains a certificate that is being used by the service principal \/ managed identity. This certificate is used by Azure to authenticate the service principal. The <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/managed-identities-azure-resources\/overview#how-does-the-managed-identities-for-azure-resources-work\">Azure docs<\/a> actually explain where\/how this certificate is generated and stored:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/managed-identities-azure-resources\/media\/overview\/msi-vm-vmextension-imds-example.png\" alt=\"Managed service identities and Azure VMs\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In step 3 of the process diagram above, the info of the ARM generated service principal is stored in the instance metadata service (IMDS), along with a certificate. In step 5, when you call the IMDS, the IMDS will use this certificate to authenticate the service principal. What&#8217;s good to know here, as this is a managed identity, is that you don&#8217;t have to rotate these certs, Azure will do that on your behalf. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Second interesting part in that JSON body:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"objectType\": \"ServicePrincipal\",\n(...)\n\"servicePrincipalType\": \"ManagedIdentity\",<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Although this object is indeed a ServicePrincipal, Azure AD has a special type of service principals called ManagedIdentity, to identity that this is a managed identity. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s wrap all of this up. The main question I wanted to answer was, &#8220;How can I enable developers to create service principals&#8221;. There are two ways to enable your dev teams to create those:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Enable everyone in your org to register applications.<\/li><li>Give your devs the application developer role in Azure AD.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">We also explored the impact on Managed Identities, and were able to conclude that even if you cannot do application registrations, you&#8217;ll be able to create a Managed Identity. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common question I get from customers is how they can enable their development teams to create service principals. In this post, I&#8217;ll explain how you can achieve this. We&#8217;ll finish the post by exploring the impact on Managed Identities as well. During the writing of the Managed Identities piece, I hit something I hadn&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":381,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,4],"tags":[8,29,30],"class_list":["post-375","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-management","tag-azure","tag-azure-ad","tag-managed-identity"],"jetpack_featured_media_url":"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/09\/image-52.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":1,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/375\/revisions\/392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/media\/381"}],"wp:attachment":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}