-
Notifications
You must be signed in to change notification settings - Fork 0
docs(azure-oidc): update docs and added examples #899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| formatter: "markdown" | ||
|
|
||
| version: "" | ||
|
|
||
| header-from: docs/header.md | ||
| footer-from: docs/footer.md | ||
|
|
||
| recursive: | ||
| enabled: false | ||
| path: modules | ||
| include-main: true | ||
|
|
||
| sections: | ||
| hide: [] | ||
| show: [] | ||
|
|
||
| content: "" | ||
|
|
||
| output: | ||
| file: "README.md" | ||
| mode: inject | ||
| template: |- | ||
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> | ||
|
|
||
| output-values: | ||
| enabled: false | ||
| from: "" | ||
|
|
||
| sort: | ||
| enabled: true | ||
| by: name | ||
|
|
||
| settings: | ||
| anchor: true | ||
| color: true | ||
| default: true | ||
| description: false | ||
| escape: true | ||
| hide-empty: false | ||
| html: true | ||
| indent: 2 | ||
| lockfile: true | ||
| read-comments: true | ||
| required: true | ||
| sensitive: true | ||
| type: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| module "azure_oidc" { | ||
| source = "../../" | ||
|
|
||
| data = { | ||
| app_registrations = [ | ||
| { | ||
| name = "service_repositories" | ||
| roles = ["AcrPush", "AcrPull"] | ||
| scope = [ | ||
| "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/foo/providers/Microsoft.ContainerRegistry/registries/foo-registry" | ||
| ] | ||
| federated_credentials = [ | ||
| { | ||
| subject = "repository_owner:prefapp" | ||
| issuer = "https://token.actions.githubusercontent.com" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| data: | ||||||||||||||||||||||||||||||||||||||||||||
| app_registrations: | ||||||||||||||||||||||||||||||||||||||||||||
| - name: service_repositories | ||||||||||||||||||||||||||||||||||||||||||||
| roles: | ||||||||||||||||||||||||||||||||||||||||||||
| - AcrPush | ||||||||||||||||||||||||||||||||||||||||||||
| - AcrPull | ||||||||||||||||||||||||||||||||||||||||||||
| scope: | ||||||||||||||||||||||||||||||||||||||||||||
| - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/foo/providers/Microsoft.ContainerRegistry/registries/foo-registry | ||||||||||||||||||||||||||||||||||||||||||||
| federated_credentials: | ||||||||||||||||||||||||||||||||||||||||||||
| - subject: repository_owner:prefapp | ||||||||||||||||||||||||||||||||||||||||||||
| issuer: https://token.actions.githubusercontent.com | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+11
|
||||||||||||||||||||||||||||||||||||||||||||
| data: | |
| app_registrations: | |
| - name: service_repositories | |
| roles: | |
| - AcrPush | |
| - AcrPull | |
| scope: | |
| - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/foo/providers/Microsoft.ContainerRegistry/registries/foo-registry | |
| federated_credentials: | |
| - subject: repository_owner:prefapp | |
| issuer: https://token.actions.githubusercontent.com | |
| app_registrations: | |
| - name: service_repositories | |
| roles: | |
| - AcrPush | |
| - AcrPull | |
| scope: | |
| - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/foo/providers/Microsoft.ContainerRegistry/registries/foo-registry | |
| federated_credentials: | |
| - subject: repository_owner:prefapp | |
| issuer: https://token.actions.githubusercontent.com |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ## Examples | ||
|
|
||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-oidc/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azure-oidc/_examples/basic) - OIDC and federated credentials configuration for workloads (e.g., GitHub Actions). | ||
|
|
||
| ## Resources and support | ||
|
|
||
| - [Official Azure AD Application documentation](https://learn.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals) | ||
| - [Terraform reference for azuread_application](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application) | ||
| - [Terraform reference for azuread_application_federated_identity_credential](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application_federated_identity_credential) | ||
| - [Terraform reference for azurerm_role_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | ||
|
|
||
| ## Support | ||
|
|
||
| For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,98 @@ | ||||||
| # Azure OIDC Terraform Module | ||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| This Terraform module creates Azure AD applications, service principals, and role assignments for each application defined in the input data file. It supports federated credentials for GitHub Actions and other issuers. | ||||||
|
|
||||||
| > Note: Not defining a scope in an application is equivalent to defining the scope of the subscription. | ||||||
|
|
||||||
| ## Main features | ||||||
| - Create multiple Azure AD applications and service principals. | ||||||
| - Assign custom roles and scopes to each application. | ||||||
| - Add federated credentials for GitHub Actions or custom issuers. | ||||||
| - Realistic configuration example. | ||||||
|
|
||||||
| ## Complete usage example | ||||||
|
|
||||||
| ### Module usage | ||||||
| ```hcl | ||||||
| module "github-oidc" { | ||||||
|
||||||
| module "github-oidc" { | |
| module "github_oidc" { |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example uses the top-level key applications, but the realistic example (and the _examples/basic config) use app_registrations. This inconsistency will confuse users and can lead to invalid inputs. Align the docs to a single expected input shape (preferably app_registrations if that’s what the module consumes).
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the typo state_repositorie to state_repositories.
| - name: state_repositorie | |
| - name: state_repositories |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the typo infra_repositorie to infra_repositories.
| - name: infra_repositorie | |
| - name: infra_repositories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
versionto an empty string may be treated as an invalid value by terraform-docs and can fail parsing/validation depending on the tool version. If you don’t want to pin a version, omit the field; otherwise set it to a valid version string.