Export data to Azure Storage using a Runbook and Powershell

Michel Sfeir 125 Reputation points
2025-03-11T15:15:00.3966667+00:00

Hello,

I'm trying to export some data to a csv file and then copy the file to blob storage without saving the file locally or in cloudshell. Is there any way to do that?

Best Regards,

Michel

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,327 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michel Sfeir 125 Reputation points
    2025-03-12T14:21:29.91+00:00

    I used the below piece of code and it worked fine. It copies the file to Azure sandbox temp location.

    $report | Export-CSV ($env:TEMP+"file.csv") -Notype

    0 comments No comments

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.