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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to send csv to azure blob

(0) ShareShare
ReportReport
Posted on by
Hi Experts,
 
I want to store csv file to azure blob for that i have written a code. Right now it is storing csv file to local computer but i want in azure blob. Please correct this code and guide what to do to achieve that.
 
 
Thanks in advance.
stream = csvFile.getStream();        stream.Position = 0;        if(ledgerParametersLoc.TOBDerivativeAzureBlobAccountKey && ledgerParametersLoc.TOBDerivativeAzureBlobAccountName && ledgerParametersLoc.TOBDerivativAzureBlobContainerName)        {            CO_FileUploader::dropFileOnAzureBlobStorage(stream,ledgerParametersLoc.TOBDerivativeAzureBlobAccountName,ledgerParametersLoc.TOBDerivativeAzureBlobAccountKey, ledgerParametersLoc.TOBDerivativAzureBlobContainerName, filename);                    reader = new System.IO.StreamReader(stream);        csvFileContent = reader.ReadToEnd();        File::SendStringAsFileToUser(csvFileContent,  filename);
 
I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,158 Super User 2025 Season 2 on at
    Hi Community member,
     
    Check this link please if it helps (as it's similar to your question and it shows how to send stream to azure blob)
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Martin Dráb Profile Picture
    238,286 Most Valuable Professional on at
    Let me re-post your code.
    stream = csvFile.getStream();
    stream.Position = 0;
    
    if (ledgerParametersLoc.TOBDerivativeAzureBlobAccountKey
        && ledgerParametersLoc.TOBDerivativeAzureBlobAccountName
        && ledgerParametersLoc.TOBDerivativAzureBlobContainerName)
    {
        CO_FileUploader::dropFileOnAzureBlobStorage(
            stream,
            ledgerParametersLoc.TOBDerivativeAzureBlobAccountName,
            ledgerParametersLoc.TOBDerivativeAzureBlobAccountKey,
            ledgerParametersLoc.TOBDerivativAzureBlobContainerName,
            filename);
    
        reader = new System.IO.StreamReader(stream);
        csvFileContent = reader.ReadToEnd();
        File::SendStringAsFileToUser(csvFileContent,  filename);
    }
    The usage of File::sendStringAsFileToUser() suggests that you're actually using F&O, not AX, therefore let me more this thread to Dynamics 365 Finance forum.
     
    Unfortunately, we can't find the problem with your code to update to a blob storage but you didn't share the code with us. It seems you have it in CO_FileUploader::dropFileOnAzureBlobStorage(), therefore that's the code you should show. Also, you didn't tell us what kind of problem you have with it.

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

News and Announcements

Season of Giving Solutions is Here!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 405 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 322 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans