question

WangJane-5356 avatar image
0 Votes"
WangJane-5356 asked SumanthMarigowda-MSFT edited

remote run FileShare mount command result in disconnected state

We followed Invoke-Command -ComputerName COMPUTER -ScriptBlock {​​​ COMMAND }​​​ -credential USERNAME
and run remotely against Azure Linux VM from script. The script looks like the following

az vm run-command invoke --command-id RunPowerShellScript --name test-vm -g omms-pep-daily \
--scripts 'param([string]$storageAccessKey)' \
'$resourceGroupName = <Resource Group Name>' \
'$storageAccountName = <Storage Account Name>' \
'$shareName = <File share name>' \
'Test-NetConnection -ComputerName "$storageAccountName.file.core.windows.net" -Port 445' \
'$accountKey = ConvertTo-SecureString -String <Storage Account Key> -AsPlainText -Force' \
'$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Azure\$storageAccountName", $accountKey' \
'New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\$storageAccountName.file.core.windows.net\$shareName" -Credential $credential -Persist -Scope Global'

This mounted the fileshare in a discounted state. On the other hand, we do not have the access to run the script from within the Linux VM, although running from the VM directly works.

Is there a way to mount FileShare onto VM remotely, using the extension cmd, or any other way?

azure-virtual-machinesazure-files
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SumanthMarigowda-MSFT avatar image
0 Votes"
SumanthMarigowda-MSFT answered SumanthMarigowda-MSFT edited

@WangJane-5356 Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

If the issue still persists, I would recommended refer this Troubleshoot Azure Files problems in Linux (SMB) (This article lists common problems that are related to Azure Files when you connect from Linux clients. It also provides possible causes and resolutions for these problems)

If the issue still persists, Please share the screen shot of the error message.

How to mount an NFS file share

Use Azure Files with Linux

Hope this helps!

Kindly let us know if the above helps or you need further assistance on this issue.


Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.