Can I use both Get-AzRmStorageShare and Get-AzStorageShare modules in an Azure Automation Runbook? Body:

Suthii09 40 Reputation points
2025-02-12T08:51:09.0733333+00:00

Hi,

I currently have two different PowerShell scripts running locally on my machine, where one uses the Get-AzRmStorageShare module and the other uses the Get-AzStorageShare module to retrieve usage and quota information for an Azure File Share. Both scripts are working fine in my local environment.

Now, I am planning to migrate these scripts to Azure Automation. My question is:

  1. My question is:
    1. Which of the two modules (Get-AzRmStorageShare or Get-AzStorageShare) is supported and works properly within Azure Automation Runbooks
    2. Are there any limitations or prerequisites to using either of these modules in the Automation environment?

Any insights or suggestions would be greatly appreciated!

Thanks!

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,311 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,629 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pranay Reddy Madireddy 2,085 Reputation points Microsoft Vendor
    2025-02-12T09:32:47.5366667+00:00

    Hi Suthii09

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Get-AzStorageShare: The cmdlet you should use is part of the Az.Storage module, which is included in the Az module library. It’s the recommended choice for interacting with Azure Storage shares in Azure Automation.

    Azure Automation: Azure Automation supports the Az module, and it’s essential to import this module into your Automation account. The Az module is continuously updated with the latest features, which ensures you’re working with the most current and secure resources.

    Make sure your Automation account has the right permissions to access the Azure File Share, using a Run As account or Managed Identity.

    If your scripts are using AzureRM, we recommend switching to the Az module. Make sure to test your scripts in the Azure Automation environment to ensure they work properly.
    User's image

    https://learn.microsoft.com/en-us/powershell/module/az.storage/?view=azps-13.2.0&viewFallbackFrom=azps-latest
    https://learn.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-13.2.0&viewFallbackFrom=azps-latest

    https://learn.microsoft.com/en-us/azure/automation/migrate-run-as-accounts-managed-identity?tabs=sa-managed-identity
    https://learn.microsoft.com/en-us/azure/automation/enable-managed-identity-for-automation

    If you have any further queries, do let us know.


    If the answer is helpful, please and "Upvote it".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.