-
Notifications
You must be signed in to change notification settings - Fork 301
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_access_package_resource_package_association only supports groups #1066
Comments
@mariussm Thank you for requesting this. I can see that the current design may have made some assumptions, however we can expand the support as needed. Thanks for writing the blog post to help spread knowledge about this feature. To help with designing the schema for supporting applications as well as groups, would you be able to post some examples of AccessPackageResourceRoleScopes that you have used? Thanks! |
Hi, I'm not sure if this is the kind of example you wanted but an AccessPackageResourceRoleScope for an approle looks like this: {
"accessPackageResourceRole": {
"originSystem": "AadApplication",
"originId": "22222222-2222-2222-2222-222222222222",
"accessPackageResource": {
"id": "33333333-3333-3333-3333-333333333333",
"originId": "11111111-1111-1111-1111-111111111111",
"originSystem": "AadApplication",
},
},
"accessPackageResourceScope": {
"originId": "11111111-1111-1111-1111-111111111111",
"originSystem": "AadApplication",
}
}
Where:
You should be able to get the servicePrincipal id and the originSystem from fetching the accessPackageResource internally (which I think you're already doing for the groups?). So all that would be needed is an attribute to provide the GUID of the approle (or other kinds of resources like Sharepoint Online site roles which look like they work the same way). As for access_type, you could change it so it is only used it when the originSystem is AadGroup, but that's up to you. |
It seems to be also an issue for {
"id": "6e5d82c3-f456-472e-b86e-46c7e0c20b0b_6d4f659f-b5f6-4949-93e5-9ea208fe608c",
"createdBy": "[email protected]",
"createdDateTime": "2020-01-10T08:21:15.273Z",
"modifiedBy": "[email protected]",
"modifiedDateTime": "2020-01-10T08:21:15.273Z",
"[email protected]": "https://graph.microsoft.com/beta/$metadata#identityGovernance/entitlementManagement/accessPackages('2cf4eb96-0dd0-4d1c-a9ac-48f65f93090e')/accessPackageResourceRoleScopes('6e5d82c3-f456-472e-b86e-46c7e0c20b0b_6d4f659f-b5f6-4949-93e5-9ea208fe608c')/accessPackageResourceRole/$entity",
"accessPackageResourceRole": {
"id": "6e5d82c3-f456-472e-b86e-46c7e0c20b0b",
"displayName": "Some Display Name",
"description": null,
"originSystem": "SharePointOnline",
"originId": "5"
},
"[email protected]": "https://graph.microsoft.com/beta/$metadata#identityGovernance/entitlementManagement/accessPackages('2cf4eb96-0dd0-4d1c-a9ac-48f65f93090e')/accessPackageResourceRoleScopes('6e5d82c3-f456-472e-b86e-46c7e0c20b0b_6d4f659f-b5f6-4949-93e5-9ea208fe608c')/accessPackageResourceScope/$entity",
"accessPackageResourceScope": {
"id": "6d4f659f-b5f6-4949-93e5-9ea208fe608c",
"displayName": "Root",
"description": "Root Scope",
"originId": "https://company.sharepoint.com/sites/mysite",
"originSystem": "SharePointOnline",
"roleOriginId": null,
"isRootScope": true,
"url": null
}
} We can see the originID is not a regular UUID so it's not possible to import this resource to a |
hi guys, |
We've come across this too, I'm hoping the solution is this - granting the "Group.ReadWrite.All" permission: |
Confirming that azuread_access_package_resource_package_association still does not support applications. Even tried a workaround where i created an app role called "Member" for the associated app and then tried using access_type = "Member". Still didn't work. |
Now it is not a group we're trying to add but an application service principal. The "Group.ReadWrite.All" will not work. Yet it is actually been added as we also need that feature for other purposes. The permission that should fit is "EntitlementManagement.ReadWrite.All" but it does not help. The error meesage we got also indicate that the ownership is not being read correctly. So we do not think it is a permission issue... This is clearly a bug |
I can confirm this is still an issue. When trying to add a service principal application, I am receiving the following error: |
Hello, we managed to get this working by granting "Application.ReadWrite.All". Previously we were using "Application.Read.All" and "Application.ReadWrite.OwnedBy" Error was: Error: Failed to request Access Package Resource Catalog Association (Catalog ID: "Identity Governance Entitlement Management Access Package Catalog (Access Package Catalog: \"xxx\")" / Origin ID: "xxx")
with azuread_access_package_resource_catalog_association.this,
on catalog.tf line 16, in resource "azuread_access_package_resource_catalog_association" "this":
16: resource "azuread_access_package_resource_catalog_association" "this" {
unexpected status 400 (400 Bad Request) with error: CallerNotResourceOwner:
The caller is not the resource owner. |
Community Note
Terraform (and AzureAD Provider) Version
2.37.0
Affected Resource(s)
azuread_access_package_resource_package_association
Terraform Configuration Files
Expected Behavior
When an application is provided, the default role of 00000000-0000-0000-0000-000000000000 should be used, while "Member" should be used for groups.
Currently only Member and Owner is supported values for access_type, which only works for groups. We need to be able to provide guids, that correlates to the resource roles of the resource, such as app roles for applications.
Actual Behavior
Fails, because it tries to assign the member role, which does not exist for applications
Steps to Reproduce
Simply try to assign an application instead of a group
I have blogged about it, so you can also find some details here: https://goodworkaround.com/2023/04/14/terraforming-your-way-through-azure-ad-entitlement-management/
The text was updated successfully, but these errors were encountered: