Azure automation runbooks(multiple) are not appending to same blob storage

Azure-learning 56 Reputation points
2022-10-31T05:59:48.037+00:00

Azure automation runbooks are not appending to same blob storage.
I have 5 runbooks from where I am sending log data to a common storage account blob file. as below

Set-AzStorageBlobContent -Container "data" -File "file" -Blob "$Year/$Month/$Day/status.csv" -Context $context -Force

but it is removing the content of other runbooks , it's not appending when running the powershell scripts using automation runbooks. it's just deleting previously written content from other
runbooks .
if I am trying the same powershell scripts from local (vscode), it's working fine . all the scripts are appending to same storage account. but when i am running using runbooks it's not appending.

please suggest

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.
1,825 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
1,678 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
814 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.
4,884 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Azure-learning 56 Reputation points
    2022-10-31T06:35:13.393+00:00

    i have added append -Blobtype append also but it's not saving other jobs status that was written previously before the current run

    0 comments No comments

  2. Carlos Villagomez 871 Reputation points Microsoft Employee
    2022-11-01T20:46:25.573+00:00

    Hello @NGaur-3476,

    Thanks for your post! I have been doing some further investigation with our Automation Team and confirmed that when you have different process running, then you should output them to separate files and then append later. From what we understand for this scenario, it appears that this is a basic OS synchronization issue that occurs when different processes all try to write to the same file and thus causing a conflict that you are seeing.

    Please let us know if you are able to perform these changes and we are happy to help you further should you have any questions or concerns.

    Thanks!
    Carlos V.