Skip to content

Commit

Permalink
Fix 301-service-fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-yechenwei committed Nov 15, 2023
1 parent 1614947 commit b788a1c
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions quickstart/301-service-fabric/azuread.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Service Fabric Cluster
resource "azuread_application" "cluster" {
name = "${var.name}-cluster-${var.environment}"
display_name = "${var.name}-cluster-${var.environment}"
}

resource "azuread_service_principal" "cluster" {
application_id = "${azuread_application.cluster.application_id}"
application_id = azuread_application.cluster.application_id
}

resource "random_string" "cluster_password" {
Expand All @@ -13,35 +13,45 @@ resource "random_string" "cluster_password" {
}

resource "azuread_service_principal_password" "cluster" {
service_principal_id = "${azuread_service_principal.cluster.id}"
value = "${random_string.cluster_password.result}"
service_principal_id = azuread_service_principal.cluster.id
value = random_string.cluster_password.result
end_date = "2099-01-01T01:00:00Z"
}

resource "random_uuid" "admin" {
}

resource "random_uuid" "reader" {
}

# Service Fabric Client
resource "azuread_application" "client" {
name = "${var.name}-client-${var.environment}"
reply_urls = ["https://${azurerm_public_ip.sf.fqdn}:19080/Explorer/index.html"]
display_name = "${var.name}-client-${var.environment}"
redirect_uris = ["https://${azurerm_public_ip.sf.fqdn}:19080/Explorer/index.html"]

app_role {
id = random_uuid.admin.result

allowed_member_types = [
"User",
]

description = "Admins can manage roles and perform all task actions"
display_name = "Admin"
is_enabled = true
enabled = true
value = "Admin"
}

app_role {
id = random_uuid.reader.result

allowed_member_types = [
"User",
]

description = "ReadOnly roles have limited query access"
display_name = "ReadOnly"
is_enabled = true
enabled = true
value = "User"
}

Expand All @@ -57,7 +67,7 @@ resource "azuread_application" "client" {
}

resource "azuread_service_principal" "client" {
application_id = "${azuread_application.client.application_id}"
application_id = azuread_application.client.application_id
}

resource "random_string" "client_password" {
Expand All @@ -66,7 +76,7 @@ resource "random_string" "client_password" {
}

resource "azuread_service_principal_password" "client" {
service_principal_id = "${azuread_service_principal.client.id}"
value = "${random_string.client_password.result}"
service_principal_id = azuread_service_principal.client.id
value = random_string.client_password.result
end_date = "2099-01-01T01:00:00Z"
}

0 comments on commit b788a1c

Please sign in to comment.