web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Automate XML File push to Azure Blob Storage on 'Export' Action Without Saving Locally

(1) ShareShare
ReportReport
Posted on by 351

On the payment journal page, there is an action (EXPORT) that, when clicked, generates an XML file and stores it on the local system. I want to transfer this file directly to Azure Blob Storage. When I click on the "Export" action, the file should be transferred to Azure Blob Storage instead of being stored locally. I wanted to store it in the azure blob storage using API and SAS token. cause after i have to apply encryption and decryption logic as well.

Is it possible to achieve this using code? I don't want to use Power Automate or any other flow. How can I do this?

I have the same question (0)
  • Suggested answer
    GL-20110726-0 Profile Picture
    2 on at
    Yes, I have it working in BC24:
     
    The steps is as simple as something like this:
    1. Initialize ABSBlobClient
        var Codeunit System.Azure.Storage."ABS Blob Client";
              StorageServiceAuthorization: Codeunit System.Azure.Storage."Storage Service Authorization";
        ABSBlobClient.Initialize(StorageAccount, ContainerName, StorageServiceAuthorization.UseReadySAS(SAS))
     
    2. Store InStream_ to Blob with PathAndFileName:
        var ABSOperationResponse: Codeunit System.Azure.Storage."ABS Operation Response";
        ABSOperationResponse := ABSBlobClient.PutBlobBlockBlobStream(PathAndFileName, InStream_);
            if not ABSOperationResponse.IsSuccessful() then
              Error(....
       
    Best regards
    Gert Lynge 
  • user 123 Profile Picture
    351 on at
    Could you please elaborate it?
  • user 123 Profile Picture
    351 on at
    I am still looking for the solution

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans