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

MalformedRoleAssignmentRequest - PASRP RoleAssignment request is malforme #8143

Closed
lanpar opened this issue Jan 2, 2019 · 5 comments
Closed
Labels
Authorization-cli question The issue doesn't require a change to the product in order to be resolved. Most issues start as that RBAC az role Service Attention This issue is responsible by Azure service team.

Comments

@lanpar
Copy link

lanpar commented Jan 2, 2019

Attempting to perform a role assignment on a service principle

#1. var assignmentGuid = msrestazure.generateUuid();

#2. body payload has both principleId and roleDefinitionId (json format)

#3. roleDefinitionId is /subscriptions/{{subscription_id}}/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635

#4. Execute the PUT
https://management.azure.com/subscriptions/{{subscription_id}}/providers/Microsoft.Authorization/roleAssignments/{{assignmentGuid}}?api-version=2015-07-01

response:

{
"error": {
"code": "MalformedRoleAssignmentRequest",
"message": "PASRP RoleAssignment request is malformed"
}
}

any help on what i need to do to fix , thanks

@tjprescott tjprescott added the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Jan 3, 2019
@tjprescott
Copy link
Member

Are you using a CLI command to try this? It looks like you are calling the REST API directly.

@lanpar
Copy link
Author

lanpar commented Jan 3, 2019

i first attempted to use the sample provided:

https://github.com/Azure/azure-sdk-for-node/tree/master/Documentation/ServicePrincipal

and got the MalformedRoleAssignmentRequest

then i attempted to manually executecalling REST API directly

same error unfortunately

@adewaleo
Copy link
Contributor

adewaleo commented Jan 3, 2019

@lanpar, this is the repo for the Azure CLI. Have you considered raising an issue on the repo you found the issue on, or reaching out to someone on the repo?

@tjprescott tjprescott added Service Attention This issue is responsible by Azure service team. Authorization labels Jan 3, 2019
@CharmanderJieniJieni
Copy link

Hitting same error through Python SDK

from azure.mgmt.authorization import AuthorizationManagementClient
from azure.mgmt.authorization.models import RoleAssignmentProperties, RoleAssignment

role_definition_id = 'acdd72a7-3385-48ef-bd42-f606fba81ae7'
group_id = '621c514c-51b6-44ca-b739-d55f0837724e'
subscription_scope = '/subscriptions/1b9acf1c-d449-4cf6-b2e7-2392b637b661'
assignment_name = 'c53bf415-70c1-486a-ae44-434492d66b20'

role_assignment_properties = RoleAssignmentProperties(role_definition_id=role_definition_id, principal_id=group_id)
result = authorization_client.role_assignments.create(self.subscription_scope, assignment_name, role_assignment_properties)

@yugangw-msft
Copy link
Contributor

Please open the issue at a right place: https://github.com/azure/azure-sdk-for-python/issues. At the same time, please run az role assignment create --debug and capture the payload on the wire to see what is the right payload you can use to construct using Python SDK. CLI's code is here for you to cross check:

@mozehgir mozehgir added the RBAC az role label Jul 26, 2019
@haroldrandom haroldrandom added RBAC az role Authorization-cli question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authorization-cli question The issue doesn't require a change to the product in order to be resolved. Most issues start as that RBAC az role Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants