0

How do I figure out what storage account and file share is currently being used by my cloud shell? Get-AzStorageAccount just gives a list of all the storage accounts...

user2736158
  • 389
  • 1
  • 6
  • 14

1 Answers1

4

You could run the df command on the Cloud Shell to discover which file share is mounted as clouddrive. For example, there is a file share path //storageaccountname.file.core.windows.net/filesharename

enter image description here

Refer to https://learn.microsoft.com/en-us/azure/cloud-shell/persisting-shell-storage#how-cloud-shell-storage-works

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • Interesting...I can see similar output, but not the filesharepath that you are seeing. But it's a start. I would have thought there would be a parameter on Get-AzStorageAccount or Get-AzFileShare, that would tell me my current session's storage account/fileshare... – user2736158 Jul 29 '20 at 02:37
  • In the output, do you see the format `//storageaccountname.file.core.windows.net/filesharename`? Then you can search the storage account name in the search bar, you will find the specific resource group name like cloud-shell-storage-region. You can get the storage context as `Get-AzStorageAccount -name storageaccountname -resourceGroupName cloud-shell-storage-region`. – Nancy Jul 29 '20 at 02:44
  • I suggest reading the linking article about how the Azure cloud shell storage works. The `Get-CloudDrive` cmdlet retrieves the Azure file share information currently mounted by the `clouddrive` in the Cloud Shell. – Nancy Jul 29 '20 at 02:51
  • Any more questions? If my reply is helpful, please accept it. – Nancy Jul 29 '20 at 06:19