Adding owners to new-sp #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: add-owners-to-app-registrations-in-terraform | |
on: | |
workflow_dispatch: | |
inputs: | |
app_registration_name: | |
type: string | |
description: "Azure App registration name" | |
required: true | |
app_registration_owner: | |
type: string | |
description: "Azure App registration owners name. Provide as comma separated in case of multiple owners" | |
required: true | |
run-name: Adding owners to ${{ inputs.app_registration_name }} | |
jobs: | |
add-owners-to-app-registrations-in-terraform: | |
runs-on: ubuntu-latest | |
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 }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Listing files | |
run: ls -la | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.6.0" | |
- name: Terraform Init | |
run: terraform init | |
- name: Terraform Plan | |
run: terraform plan -var="app_registration_name=${{ inputs.app_registration_name }}" -var="app_registration_owner=${{ inputs.app_registration_owner }}" -out "plan.out" | |
- 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 | |
- name: Process Completed | |
run: echo "Completed...." |