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

Not able to login using the user created through azure cli for sftp #27795

Closed
praveenm-symplr opened this issue Nov 8, 2023 · 7 comments
Closed
Assignees
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage
Milestone

Comments

@praveenm-symplr
Copy link

praveenm-symplr commented Nov 8, 2023

Describe the bug

Not able to login using the user created through azure cli for sftp.

I have two users one created from the azure cli with permissions and one manually from azure portal. The permissions are same for both.

When I use the ftp client to login with the user which created from azure portal works fine but it is failing for the user created through azure-cli.

On comparison of both users by getting all the users,
az storage account local-user list --account-name myAccountName -g myResourceGroup

There looks to be a "Blob" and "blob". If it is "Blob" (created from azure-cli) it looks to be not working
image

Related command

creating the user
az storage account local-user create --account-name $storageAccountName --resource-group $resourceGroupName --user-name $localUserName --home-directory $homeDirectory $scopes --has-ssh-password $true

To list the users and permissions
az storage account local-user list --account-name $storageAccountName -g $resourceGroupName

Errors

There were no errors observed.

Issue script & Debug output

Provided the info

Expected behavior

The user created using the azure-cli should be working when we try to login from sftp.
Should be ideally the same behavior as we are are creating a new user from azure portl.

Environment Summary

azure-cli 2.51.0

Additional context

No response

@praveenm-symplr praveenm-symplr added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 8, 2023
Copy link

Hi @praveenm-symplr,

2.51.0 is not the latest Azure CLI(2.53.1).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Nov 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels Nov 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Nov 8, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 8, 2023

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 8, 2023
@praveenm-symplr
Copy link
Author

Related to #26723

@yonzhan yonzhan added this to the Backlog milestone Nov 8, 2023
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 8, 2023
@calvinhzy
Copy link
Member

Hi @praveenm-symplr, wondering if you can show screenshots to the command that you have run. I am able to get it work with these commands.
az storage account local-user create --account-name satestlocaluser --resource-group rgtestlocaluser --user-name localuser2 --home-directory container1/home --permission-scope permissions=rwdlc service=blob resource-name=container1 --has-ssh-password true
az storage account local-user regenerate-password --name localuser2 --account-name satestlocaluser --resource-group rgtestlocaluser
You can see the permissionscope service is "blob".
image

@praveenm-symplr
Copy link
Author

praveenm-symplr commented Nov 8, 2023

@calvinhzy It looks to be the problem in our code. we sent service="Blob" instead of "blob". There looks to be no validation from the azure-cli side or change the case before storing it.

When we sent "blob" instead of "Blob" for the service it worked fine. Thank you so much for checking.

@calvinhzy
Copy link
Member

I am surprised that this capitalization difference would cause the issue, will look to add that validation in CLI.

@praveenm-symplr
Copy link
Author

I am surprised that this capitalization difference would cause the issue, will look to add that validation in CLI.

Yeah you can try changing the service value to "Blob" and see if you are able to login for that user.

That is the only difference I could make out from the user created through code vs portal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage
Projects
None yet
Development

No branches or pull requests

4 participants