Skip to content

Commit

Permalink
test sp creation
Browse files Browse the repository at this point in the history
  • Loading branch information
clubcaliche authored Dec 19, 2024
1 parent 800dc71 commit 1e1496a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Create Azure AD App Registration
resource "azuread_application" "app" {
display_name = "misfirm2_service_principal"
}

# Create Service Principal
resource "azuread_service_principal" "app" {
application_id = azuread_application.app.application_id
}

# Create Service Principal password
resource "azuread_service_principal_password" "app" {
service_principal_id = azuread_service_principal.app.id
}

# Resource Group
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
Expand Down
13 changes: 13 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,17 @@ output "subnet_name_1" {
output "subnet_name_2" {
description = "The name of the created subnet 2."
value = azurerm_subnet.misfirm_subnet_2.name
}

# Output the Service Principal and password
output "appID" {
description = "Service Principal ID"
value = azuread_service_principal.app.id
sensitive = true
}

output "appSecret" {
description = "Service Principal secret"
value = azuread_service_principal_password.app.value
sensitive = true
}

0 comments on commit 1e1496a

Please sign in to comment.