Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

az kusto database-principal-assignment create doesn't work with role UnrestrictedViewers #16469

Open vladris opened 3 years ago

vladris commented 3 years ago

Kusto

I'm trying to use the az kusto database-principal-assignment command to grant UnrestrictedViewers access but I get the following error: (BadRequest) Database principal role is invalid. Please provide valid database principal role (Admin, Viewer, User, etc.)..

Here is the full command for context:

$me = az ad signed-in-user show --query objectId

az kusto database-principal-assignment create `
--cluster-name "mycluster" `
--database-name "mydatabase"`
--principal-id $me `
--principal-type User `
--role UnrestrictedViewers `
--principal-assignment-name "assignmentname" `
--resource-group "myrg"

Running az kusto database-principal-assignment create -h shows UnrestrictedViewers as one of the allowed values for role, but looks like the server rejects it.

yonzhan commented 3 years ago

kusto

vladris commented 3 years ago

FWIW I reported a similar issue here: https://github.com/Azure/azure-cli/issues/13330

In that case, I believe the set of values allowed by the client was different than the set of values accepted by the server. I wonder if something similar is happening here, maybe slight difference in naming between UnrestrictedViewers and whatever the server expects.

yonzhan commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @radennis.

vladris commented 3 years ago

So any thoughts on this?

radennis commented 3 years ago

Adding @ilayrn and @orhasban

astauben commented 3 years ago

Hi @vladris it is indeed bug in our clients, the role name is not supported in the server side. We will fix this issue, and future clients will have the right property name.

In the meanwhile, would you like us add the role to your database manually?

vladris commented 3 years ago

No, that's OK. Thanks for offering. I know how to add roles manually, was just looking at Azure CLI automation so I'll wait for the fix.

astauben commented 3 years ago

OK. Thanks for reporting this bug.

vladris commented 3 years ago

Any idea when this will be fixed?

astauben commented 3 years ago

We are planning to release new client (with the fix) around mid March. I'll update the thread once the new client is released.