add owners to azure app registrations from github workflow
- This repo uses terraform to add owners to a app registration created in Azure.
input name | description | type | mandatory |
---|---|---|---|
app_registration_name | Azure App registration name | string | ✔️ |
app_registration_owner | App registration owners names | string | ✔️ |
- Clone the repo and switch to the folder
- cd azure-add-owners-to-app-registations-from-ui
- Then run
terraform init
- run
terraform validate
- then
terraform plan
- then
terraform apply
- Need a app registation existing in Azure portal
- We wont be able to add same owner multiple times
- Azure active directory user shuld have a proper mail id available
-
Go to your cloned repo and then to actions tab
-
Choose the workflow
add_owner_to_app_registration.yaml
on left side -
Next click on
Run Workflow
and enter the input parameters required -
Click on
Run Workflow
-
After the job is completedd, The owners will be added to app registration
authentication to azure is done using service principal
env:
ARM_CLIENT_ID: ${{ secrets.OWNER_SP_APP_ID }}
ARM_CLIENT_SECRET: ${{ secrets.OWNER_SP_APP_SECRET }}
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
ARM_CLIENT_ID
, ARM_CLIENT_SECRET
, ARM_TENANT_ID
, ARM_SUBSCRIPTION_ID
are required Environment variables.
I used Github secrets on the workflow for authentication.
Reference - using-secrets-in-github-actions
####` Refer configuring-the-service-principal-in-terraform