{"id":20463205,"url":"https://github.com/devwithkrishna/azure-create-app-registrations-using-terraform","last_synced_at":"2026-04-10T23:38:45.743Z","repository":{"id":246092379,"uuid":"819970994","full_name":"devwithkrishna/azure-create-app-registrations-using-terraform","owner":"devwithkrishna","description":"Create app registrations in Azure using terraform and github workflow","archived":false,"fork":false,"pushed_at":"2024-12-10T11:57:10.000Z","size":18,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-16T00:55:50.953Z","etag":null,"topics":["app-registration","azure","github","github-workflow","terraform"],"latest_commit_sha":null,"homepage":"https://github.com/devwithkrishna/azure-create-app-registrations-using-terraform","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devwithkrishna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-25T14:40:02.000Z","updated_at":"2024-12-10T11:57:14.000Z","dependencies_parsed_at":"2024-12-10T12:43:10.507Z","dependency_job_id":null,"html_url":"https://github.com/devwithkrishna/azure-create-app-registrations-using-terraform","commit_stats":null,"previous_names":["devwithkrishna/azure-create-app-registrations-using-terraform"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-create-app-registrations-using-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-create-app-registrations-using-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-create-app-registrations-using-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-create-app-registrations-using-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devwithkrishna","download_url":"https://codeload.github.com/devwithkrishna/azure-create-app-registrations-using-terraform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242023192,"owners_count":20059297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app-registration","azure","github","github-workflow","terraform"],"created_at":"2024-11-15T13:09:53.863Z","updated_at":"2026-04-10T23:38:40.700Z","avatar_url":"https://github.com/devwithkrishna.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azure-create-app-registrations-using-terraform\nCreate app registrations in Azure using terraform and github workflow\n\n# How code works\n\n* This repo uses terraform to create app registration and service principal in Azure.\n\n# parameters used\n\n| input name | description | type | mandatory |\n|------------|------------|-----|-------------|\n| app_registration_name | Azure App registration name | string | :heavy_check_mark: |\n| app_registration_owner | App registration owners names | string | :heavy_check_mark: |\n| app_registration_description | App registration description | string | |\n| app_registation_expiry | App registration secret expiry | Choice - `30`,`60`,`90`,`120`,`150`,`180`,`270`,`360` | :heavy_check_mark: |\n\n# Terraform commands and How to run the code locally\n\n1. Clone the repo and switch to the folder\n2. cd azure-create-app-registrations-using-terraform\n3. Then run `terraform init`\n4. run `terraform validate`\n5. then `terraform plan`\n6. provide the values when popped up\n7. then `terraform apply` and provide `yes` as confirmation\n\n## Conditions\n\n* Azure active directory user should have a proper mail id available\n\n# How to run as a github workflow\n\n1. Go to your cloned repo and then to actions tab\n\n2. Choose the workflow `azure-create-app-registrations-using-terraform.yaml` on left side\n\n3. Next click on `Run Workflow` on right side top and enter the input parameters required\n\n4. Click on `Run Workflow` (green one)\n\n5. After the job is completed, The app registration and sp will be created with owners\n\n# Credentials needed\n\n**Authentication to Azure is done using service principal**\n\n```\nenv:\n    ARM_CLIENT_ID: ${{ secrets.APP_ID }}\n    ARM_CLIENT_SECRET: ${{ secrets.APP_SECRET }}\n    ARM_TENANT_ID: ${{ secrets.TENANT_ID }}\n    ARM_SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}\n```\n\n`ARM_CLIENT_ID`, `ARM_CLIENT_SECRET`, `ARM_TENANT_ID`, `ARM_SUBSCRIPTION_ID` are required Environment variables.\n\nI used GitHub secrets on the workflow for authentication. \n\n\n##### This creates a secret with specified validity and updates the same on keyvault\n\n```\n\u003cSP name\u003e-SECRET\n\u003cSP name-APPID\u003e\n\u003cSP name-TENANT\u003e\n```\n* when creating Keyvault secrets, SP names will be converted to all capital letters\n\n\n#References\n* [using-secrets-in-github-actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions)\n* [azuread_application_password](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application_password)\n* [azuread_service_principal](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/service_principal)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwithkrishna%2Fazure-create-app-registrations-using-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevwithkrishna%2Fazure-create-app-registrations-using-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwithkrishna%2Fazure-create-app-registrations-using-terraform/lists"}