web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Martin Dráb Profile Picture
    236,503 Most Valuable Professional on at
    How to send csv to azure blob
    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.
  • Suggested answer
    Layan Jwei Profile Picture
    8,049 Super User 2025 Season 2 on at
    How to send csv to azure blob
    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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,882

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 525 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans