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 :
Microsoft Dynamics AX (Archived)

Unable to connect to Azure storage

(0) ShareShare
ReportReport
Posted on by

I have to save the pdf file. I am able to get the pdf in the file stream with the help of the following code:

public System.IO.MemoryStream GenerateStreamFromString(str s)
{
     System.IO.MemoryStream stream = new System.IO.MemoryStream();
     System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
     writer.Write(s);
     writer.Flush();
     stream.Position = 0;
     return stream ;
}

When I am trying to save this pdf stream with the help of the following code

File::SendFileToUser(demo.GenerateStreamFromString(content), "TestCustomer.pdf");

I am getting following error.

 file-issue.JPG

Error text:

Sorry, something went wrong and the file wasn't downloaded. 

Sorry, something went wrong and the file wasn't uploaded. 

Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.PerformOperation(CloudStorageAccount storageAccount, String tableName, Func`1 operation) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.AddRecord[T](CloudStorageAccount storageAccount, String tableName, T record) at Microsoft.DynamicsOnline.Infrastructure.Components.SharedServiceUnitStorage.SharedServiceUnitStorage.UploadData(SharedServiceUnitStorageData data, Stream stream) at Dynamics.AX.Application.FileUploadTemporaryStorageStrategy.completeUpload(Boolean _blobAlreadyExists, String _uniqueFileName, String _originalFilename, String _fileId, Stream _stream, String _contentType, Boolean @_contentType_IsDefaultSet) in xppSource://Source/ApplicationPlatform\AxClass_FileUploadTemporaryStorageStrategy.xpp:line 135

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    Hi Deep, I moved your question from Show xml in Dynamics 365 for Operations Browser tab, because although it's also about file manipulation, it's a completely different problem.

  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    Do other downloads work, such as if you try to download a file attached to a record in AX?

    By the way, I wonder how you want to create a PDF file from text if PDF isn't a textual format.

  • Jos Litjens Profile Picture
    1 on at

    Martin's right, you can't just transform a text string to pdf, it's not that simple. For starters you should have the pdf stored as a blob in your database, then you can put it into a stream and download it. Here's a simple example (from Martin coincidentally) for up- and downloading a file. dev.goshoom.net/.../file-upload-and-download-in-ax-7

    There are tools/dll's for converting text to pdf, but that would require a third party dll. AX2012 has a built-in pdf writer/printer, I don't know if AX7 still has that. Maybe you could use that printer to create a pdf.

  • Verified answer
    Community Member Profile Picture
    on at

    Apologies for replying late but i was able to resolve the issue.

    Cause:

    The “AzureStorageEmulator.exe” service was not installed neither running on the machine

    Resolution:

    Installing and running the “AzureStorageEmulator.exe” service resolved the issue

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans