Skip to content

Commit

Permalink
Exposing Application ID
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Sep 20, 2017
1 parent 76cec9c commit 1e0e43b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions azurerm/data_source_arm_client_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func dataSourceArmClientConfig() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"service_principal_application_id": {
Type: schema.TypeString,
Computed: true,
},
"service_principal_object_id": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -54,6 +58,7 @@ func dataSourceArmClientConfigRead(d *schema.ResourceData, meta interface{}) err
d.Set("client_id", client.clientId)
d.Set("tenant_id", client.tenantId)
d.Set("subscription_id", client.subscriptionId)
d.Set("service_principal_application_id", *servicePrincipal.AppID)
d.Set("service_principal_object_id", *servicePrincipal.ObjectID)

return nil
Expand Down
1 change: 1 addition & 0 deletions azurerm/data_source_arm_client_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestAccDataSourceAzureRMClientConfig_basic(t *testing.T) {
testAzureRMClientConfigAttr(dataSourceName, "client_id", clientId),
testAzureRMClientConfigAttr(dataSourceName, "tenant_id", tenantId),
testAzureRMClientConfigAttr(dataSourceName, "subscription_id", subscriptionId),
testAzureRMClientConfigGUIDAttr(dataSourceName, "service_principal_application_id"),
testAzureRMClientConfigGUIDAttr(dataSourceName, "service_principal_object_id"),
),
},
Expand Down
3 changes: 2 additions & 1 deletion website/docs/d/client_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ There are no arguments available for this data source.
* `client_id` is set to the Azure Client ID (Application Object ID).
* `tenant_id` is set to the Azure Tenant ID.
* `subscription_id` is set to the Azure Subscription ID.
* `service_principal_application_id` is the Service Principal Application ID.
* `service_principal_object_id` is the Service Principal Object ID.

~> **Note:** To better understand "application" and "service principal", please read
~> **Note:** To better understand "application" and "service principal", please read
[Application and service principal objects in Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects).

0 comments on commit 1e0e43b

Please sign in to comment.