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.

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