diff --git a/.github/workflows/add_owner_to_app_registration.yaml b/.github/workflows/add_owner_to_app_registration.yaml index c5140d0..767f2fa 100644 --- a/.github/workflows/add_owner_to_app_registration.yaml +++ b/.github/workflows/add_owner_to_app_registration.yaml @@ -40,15 +40,14 @@ jobs: - name: Terraform show run: terraform show "plan.out" - + - name: Terraform Apply run: | ls -la terraform apply --auto-approve "plan.out" - name: Owners added for App registration - run: - echo "App registration owners - ${{ inputs.app_registration_owners }}" - # Add more steps for applying the Terraform plan + run: echo "App registration owners - ${{ github.event.inputs.app_registration_owners }}" + - name: Process Completed run: echo "Completed...." \ No newline at end of file diff --git a/README.md b/README.md index 958728f..905da47 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,35 @@ add owners to azure app registrations from github workflow * We wont be able to add same owner multiple times * Azure active directory user shuld have a proper mail id available +# How to run as a github workflow + +1. Go to your cloned repo and then to actions tab + + ![alt text](workflow.png) +2. Choose the workflow `add_owner_to_app_registration.yaml` on left side + +3. Next click on `Run Workflow` and enter the input parameters required + + ![alt text](github_workflow_inputs.jpeg) + +4. Click on `Run Workflow` + +5. After the job is completedd, The owners will be added to app registration + +# Credentials needed + +**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. + +#### Refer [configuring-the-service-principal-in-terraform](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret#configuring-the-service-principal-in-terraform) \ No newline at end of file diff --git a/github_workflow_inputs.jpeg b/github_workflow_inputs.jpeg new file mode 100644 index 0000000..abece8c Binary files /dev/null and b/github_workflow_inputs.jpeg differ diff --git a/workflow.png b/workflow.png new file mode 100644 index 0000000..4faa66b Binary files /dev/null and b/workflow.png differ