[BUG] PermissionScope.withPermissions can not add list
I would like to add read and list role to permissions, from the code I see it is possible
/*
* The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and
* Create (c).
*/
@JsonProperty(value = "permissions", required = true)
private String permissions;
and also the same in the documentation
permissions | string | The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c).
But on trial I receive an error:
Could you please advise?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @weidongxu-microsoft, @XiaofeiCao
@weidongxu-microsoft, @XiaofeiCao, this is in azure-resourcemanager-storage to make finding this easier
@alice36
Does "r" or "l" work? From the doc, it does not say the combination of them can work (hence backend could reject "rl").
@weidongxu-microsoft Yes, "r", "rw", "rwd" - I tried those combination and it works. For single l I received an error: "The value 'l' is not allowed for property permissionScope.permissions."
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.
Issue Details
I would like to add read and list role to permissions, from the code I see it is possible
/*
* The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and
* Create (c).
*/
@JsonProperty(value = "permissions", required = true)
private String permissions;
and also the same in the documentation
permissions | string | The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c).
But on trial I receive an error:
Could you please advise?
| Author: | alice36 |
|---|---|
| Assignees: | XiaofeiCao |
| Labels: |
|
| Milestone: | - |
Got it. Looping in backend, as storage control-plane seems having problem with "l" as permission.
@weidongxu-microsoft @XiaofeiCao do we have any update?
@xgithubtriage any update on storage control-plane?
Add @blueww for help if possible.
@alice36 Would you confirm it is this API? https://learn.microsoft.com/en-us/rest/api/storagerp/local-users/create-or-update?tabs=Java
@weidongxu-microsoft yes, this is correct API.
@alice36
Check with backend. "l" or "rl" works well for "blob" service (.withService("blob")), but not "file" service.
Is your use case indeed the "file" service? Could you describe it?
@weidongxu-microsoft I'm using it to add permissions to a container to specific sftp local user: PermissionScope permissionScope = new PermissionScope() .withPermissions()..
@alice36 I assume "container" would be .withService("blob") (not "file")? Would you show us this part of the code?
@weidongxu-microsoft I'm using this .withService("container")
@weidongxu-microsoft but I've observed also since yestarday that sth strange is on Azure UI when trying to add All permissions to the blob to the specific sftp local user:
but for created earlier it works:

Yeah, that is not a SDK issue, it is REST API issue, so everywhere will have same error.
Add @HimanshuChhabra and @prpandey3004 from SRP on question of whether "l" is allowed for "container", on API https://learn.microsoft.com/en-us/rest/api/storagerp/local-users/create-or-update?tabs=HTTP
{
"permissions": "l",
"service": "container",
"resourceName": "share2"
}
@weidongxu-microsoft this is PermissionScope class path com.azure.resourcemanager.storage.models.PermissionScope; from azure-resourcemanager-storage:2.22.0
@alice36
This is a storage server side issue , it looks the server behavior is not aligned with the swagger spec .
This is not java SDK specific issue, it can't be resolved by java SDK update only. When server/swagger is fixed and aligned, java sdk will also work (might need regeneration from fixed swagger).
Would you please report a storage server issue, and follow up this issue with server team?
You can report it on portal as following picture:

Any update on this issue? Trying to add a new SFTP Local User via REST API, but getting this error:
{
"error": {
"code": "InvalidRequestPropertyValue",
"message": "The value 'rwdlc' is not allowed for property permissionScope.permissions."
}
}
Seems like any permission with l (for list) in it fails.
FYI, I cannot update the Local User in Azure Portal either after creating it via the REST API
Got it working - the issue was in the permissionScopes.service property of my request body to the Azure Storage REST API Endpoint. I needed to use "blob" instead of "file".
This was my initial request body that was failing:
{
"properties": {
"permissionScopes": [
{
"permissions": "rwdcl",
"service": "file",
"resourceName": "partner-data"
}
],
"hasSshPassword": false,
"hasSharedKey": false,
"hasSshKey": false
}
}
Removing the l (for list) from the above permissionScopes.permissions property would get the Local User created in Azure. But I couldn't login via SFTP. I also couldn't add any permission that included l (for list) in the Azure Portal UI.
I realized I needed to change permissionScopes.service to "blob", like this:
{
"properties": {
"permissionScopes": [
{
"permissions": "rwdcl",
"service": "blob",
"resourceName": "partner-data"
}
],
"hasSshPassword": false,
"hasSharedKey": false,
"hasSshKey": false
}
}
Using this updated request body works perfectly and I can login now when testing with FileZilla with the programatically generated Local User.