From the course: Azure Infrastructure as Code with GitHub
Create a service principal in Azure
From the course: Azure Infrastructure as Code with GitHub
Create a service principal in Azure
- [Instructor] To connect from GitHub to Azure we're going to create a surface principle. To do that, we can log into the portal and we can choose Azure Active Directory. When we are here, we are going to scroll down the menu to App registrations. And here we're going to create a new one. You can see the button right here at the top to create a new registration. So here we can give it a name so we can recognize which registration this is when we have more registrations in our tenants. (keyboard clicking) I'll call this GitHub connection. And in this case, we can leave all the other values at the default as they are not relevant for this use case. So we'll just click register. And this was all we had to do to create that registration. Now this registration can't do anything at this point. What we need to do is give it permissions to do stuff in Azure. You can give that permission a resource group base, or on a subscription base. That depends on what fits your needs. In this case, I'm going to do it at the subscription level. So to do that, I'll move back to the main screen of Azure and I'll use subscriptions. And I'll select my subscription, and I'll click access control in the menu. And here I can select role assignments and I can add to role assignment like I would for a user or an application. So I'll click add, add role assignments and I'll make this service principle a contributor. If you also want to add roles to infrastructure as code you might want to use an owner role. I'm not going to use it with this one and you should always use the least amount of privilege. So in this case, I'll do contributor. I'll click next, and now I can click "Select members" to select the service principle we just created. (keyboard clicking) And I'll use in GitHubConnection, select. And now I can review and assign, and I'll see that on my subscription, the contributor role will be given to the app registration we just created. So now we have a registration that has the right assignment to our subscription and that we can attach to GitHub.
Contents
-
-
-
-
Create a service principal in Azure2m 32s
-
(Locked)
Create a secret in GitHub4m 40s
-
(Locked)
Set up a GitHub workflow3m 43s
-
(Locked)
Create the Azure Login Action3m 35s
-
(Locked)
Deploy the resource group2m 59s
-
(Locked)
Deploy an ARM or Bicep template through GitHub Actions4m 26s
-
(Locked)
Challenge: Create your own pipeline21s
-
(Locked)
Solution: Create your own pipeline40s
-
-
-
-