Skip to content
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

azuread_service_principal - support for the AppRoleAssignmentRequired property #127

Merged
merged 4 commits into from
Aug 21, 2019

Conversation

dmeenhuis
Copy link
Contributor

This adds support for setting the AppRoleAssignmentRequired property on a service principal.

I'm not sure if I implemented the update function correctly, but since it was not already there I think I had to create it.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dmeenhuis,

Thank you for the PR! overall this is looking pretty good,in addition to the comments i've left inline could could we get a new test (_update) that takes the basic config and updates it to complete to ensure the update function is now working? thnks!

@@ -131,7 +133,8 @@ resource "azuread_application" "test" {
}

resource "azuread_service_principal" "test" {
application_id = "${azuread_application.test.application_id}"
application_id = "${azuread_application.test.application_id}"
app_role_assignment_required = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COuld we align these assingments here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oauth2_permissions would be great, tags however we always leave at the end. Thanks!

@@ -27,6 +27,7 @@ resource "azuread_application" "example" {

resource "azuread_service_principal" "example" {
application_id = "${azuread_application.example.application_id}"
app_role_assignment_required = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we aling these assingments here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -44,6 +45,11 @@ func resourceServicePrincipal() *schema.Resource {
Computed: true,
},

"app_role_assignment_required": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this above the computed properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. What about the oauth2_permissions and tags, would you like me to move those above the computed properties as well, for consistency's sake?

@ghost ghost added size/M and removed size/S labels Jul 25, 2019
@dmeenhuis
Copy link
Contributor Author

I added a test to check the update function. Wasn't entirely sure how to go about it, so I took the update test from application and followed a similar approach for service principal and the test seems to pass. Could you let me know whether I implemented it correctly?

@ghost ghost removed the waiting-response label Jul 25, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the requested changes @dmeenhuis,

Aside from one minor comment this is looking great!

@@ -36,43 +36,47 @@ resource "azuread_service_principal" "example" {

The following arguments are supported:

* `application_id` - (Required) The ID of the Azure AD Application for which to create a Service Principal.
- `application_id` - (Required) The ID of the Azure AD Application for which to create a Service Principal.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not change these from * to - for consistency with the rest of the provider docs?

@katbyte katbyte merged commit 8078bf2 into hashicorp:master Aug 21, 2019
katbyte added a commit that referenced this pull request Aug 21, 2019
@ghost
Copy link

ghost commented Aug 21, 2019

This has been released in version 0.6.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azuread" {
    version = "~> 0.6.0"
}
# ... other configuration ...

@ghost ghost removed the waiting-response label Aug 21, 2019
@dmeenhuis
Copy link
Contributor Author

Thanks for merging these changes! I wasn't able to respond earlier since I was on holidays for the past 3 weeks.

@ghost
Copy link

ghost commented Sep 20, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants