Map a Azure Fileshare to Azure Runbook local drive to use as temporary storage

809 views Asked by At

I am trying to access an AzureStorage to utilize it in an Azure- Powershell-Runbook. I need to accomplish that to save a SharePoint-Sitetemplate to that location. Things I've tried was using:

$StorageAccountKey = Get-AutomationVariable -Name 'StorageKey'
$Context = New-AzureStorageContext -StorageAccountName 'spotemplatestore' -StorageAccountKey 
$StorageAccountKey
$container = Get-AzureStorageContainer -Name 'spotemplatestore' -Context $Context

But I don't know how to access that locally. Using New-PSDrive is not an option as it does not work with Azure Powershell Runbook Trying to use c:\ directly doesn't work either as the runbook does not have writing permissions ont c:\temp directly.

1

There are 1 answers

1
Sridevi On

As Runbooks in Azure Automation run on the Azure cloud platform, they do not have access to resources in other clouds or your local system.

In order to access resources in local system, make use of Hybrid Runbook Worker feature of Azure Automation.

Please note that,

PowerShell support to install the extension-based Hybrid Runbook Worker is not supported at this time.

To install that feature, make use of Azure portal, by following this link.

For more information, please refer the below links:

powershell - Azure Runbook - Get a file from Azure File System Storage - Stack Overflow

powershell - Not able to access Azure FileShare Storage container from Azure Automation Runbook - Stack Overflow