terraform-provider-azuread icon indicating copy to clipboard operation
terraform-provider-azuread copied to clipboard

[azuread_application] The 'type' parameter in 'oauth2_permission_scope' block is marked as Required but behaves as Optional

Open ShaheenK27 opened this issue 2 years ago • 2 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritise the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureAD Provider) Version

Terraform v1.0.0
+ provider registry.terraform.io/hashicorp/azuread v2.20.0

Affected Resource(s)

  • azuread_application

Terraform Configuration Files

The oauth2_permission_scope block is specified without type

resource "azuread_application" "app-test01" {
  display_name = "app-test01"
  api {
    oauth2_permission_scope {
      id                         = "c8c8c26a-d30e-4135-886f-490ea092e7b8"
      admin_consent_display_name = "Read-only access to Employee records"
      admin_consent_description  = "Allow the application to have read-only access to all Employee data."
      value                      = "Employees.Read.All"
    }
  }
}

Expected Behavior

  • The type parameter should be marked as Optional in the documentation.

Actual Behavior

  • The type parameter has been marked as Required in the documentation.

  • The 'Required' specification conflicts with the displayed behavior and the parameter description that type defaults to User.

Terraform apply (oauth2_permission_scope block specified without type)

Terraform will perform the following actions:

  # azuread_application.app-test01 will be created
  + resource "azuread_application" "app-test01" {
     ...
      + api {
          + requested_access_token_version = 1
          + oauth2_permission_scope {
              + admin_consent_description  = "Allow the application to have read-only access to all Employee data."
              + admin_consent_display_name = "Read-only access to Employee records"
              + enabled                    = true
              + id                         = "c8c8c26a-d30e-4135-886f-490ea092e7b8"
              + type                       = "User"  # Defaults to User. Parameter isn't specified in the terraform configuration
              + value                      = "Employees.Read.All"
            }
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Steps to Reproduce

  1. terraform apply (without type in oauth2-permission_scope block)

References

ShaheenK27 avatar Sep 15 '22 11:09 ShaheenK27

I'd like to work on it.

shijiadong2022 avatar Sep 17 '22 09:09 shijiadong2022

@shijiadong2022 Thanks! Please feel free to take a look at this :)

manicminer avatar Sep 20 '22 08:09 manicminer

This functionality has been released in v2.29.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] avatar Sep 29 '22 22:09 github-actions[bot]

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Oct 30 '22 02:10 github-actions[bot]