How to fetch mount point details in a storage account, either portalor powershell or ansible or cloudshell

Maity, Shaibal 20 Reputation points
2023-05-31T08:40:32.7133333+00:00

I want to fetch the mount-point details in a storage account. Those fileshare are mounted to the linux sersers. We have tried /etc/fstab but this is not suitable. We need to fetch from the storage account level.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,228 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,941 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,326 questions
0 comments No comments
{count} votes

Accepted answer
  1. VasimTamboli 4,785 Reputation points
    2023-05-31T09:23:09.6633333+00:00

    To fetch the mount point details in a storage account, you can use different tools and methods depending on your preference. Here's how you can do it using various options:

    Azure Portal:

    • Go to the Azure Portal (portal.azure.com) and navigate to your storage account.
    • In the left-hand menu, under the "Settings" section, click on "File shares."
    • You will see a list of file shares associated with your storage account, along with their mount points.
    1. PowerShell:

    Install the Azure Az PowerShell module if you haven't already.

    Open a PowerShell session and connect to your Azure account using the Connect-AzAccount cmdlet.

    • Run the following command to get the mount point details:

    Get-AzStorageAccount -ResourceGroupName "YourResourceGroup" -Name "YourStorageAccountName" | Get-AzStorageShare | Select-Object Name, MountPoint

    Replace "YourResourceGroup" with the name of your resource group and "YourStorageAccountName" with the name of your storage account.

    1. Ansible:

    Install the "azure.azcollection" Ansible collection if you haven't already.

    • Use the following Ansible playbook to fetch the mount point details:
    - name: Fetch mount point details from storage account
      hosts: localhost
      tasks:
        - name: Get mount points
          azure.azcollection.azure_rm_storageaccount_info:
            resource_group: YourResourceGroup
            name: YourStorageAccountName
          register: storage_info
    
        - name: Display mount points
          debug:
            msg: "{{ item.name }} - {{ item.properties.mountPoint }}"
          loop: "{{ storage_info.result.file_shares }}"
    
    
    
    

    Replace "YourResourceGroup" with the name of your resource group and "YourStorageAccountName" with the name of your storage account.

    1. Azure Cloud Shell:

    Open Azure Cloud Shell (shell.azure.com) in your browser.

    Choose either Bash or PowerShell as your preferred shell.

    • Run the following command to get the mount point details:

    az storage share list --account-name YourStorageAccountName --account-key YourStorageAccountKey --query '[].{Name: name, MountPoint: properties.mountPoint}' -o table

    Replace "YourStorageAccountName" with the name of your storage account and "YourStorageAccountKey" with the account key (primary or secondary) of your storage account.

    Choose the method that suits your needs and preferences. These options provide different ways to fetch the mount point details for file shares in your storage account.

    1.


0 additional answers

Sort by: Most helpful