AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.07.2017, 13:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,448 / 846 (79) +++++++
Регистрация: 28.10.2006
ievgensaxblog: D365FO. Working with Azure File storage.
Источник: https://ievgensaxblog.wordpress.com/...-file-storage/
==============



Current version of AX uses Azure Blob storage for various things like document handling, retail CDX files, DIXF and Excel add-in. You can find several blogs explaining how to upload and download files to Blob, SharePoint or temporary storage. However, what about file shares?

Azure File storage implements SMB 3.0 protocol and could be easily mapped to your local computer. You need just a few minutes to create new storage account and mount it, watch this how-to video for details.

To read file from newly created share we can use next code:

using Microsoft.Azure; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Blob; using Microsoft.WindowsAzure.Storage.File; class RunnableClass1 { public static void main(Args _args) { System.IO.MemoryStream memoryStream; var storageCredentials = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials('AzureStorageAccountName', 'AzureStorageAccountKey'); CloudStorageAccount storageAccount = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(storageCredentials, true); CloudFileClient fileClient = storageAccount.CreateCloudFileClient(); CloudFileShare share = fileClient.GetShareReference('AzureStorageShareName'); if (share.Exists(null, null)) { CloudFileDirectory rootDir = share.GetRootDirectoryReference(); CloudFileDirectory fileDir = rootDir.GetDirectoryReference('folder'); if (fileDir.Exists(null, null)) { CloudFile file = fileDir.GetFileReference('file.txt'); if (file.Exists(null, null)) { memoryStream = new System.IO.MemoryStream(); file.DownloadToStream(memoryStream, null, null, null); } } } } } References:




Источник: https://ievgensaxblog.wordpress.com/...-file-storage/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: trud (5).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 Blog bot NAV: Blogs 0 15.05.2016 18:12
emeadaxsupport: Connecting Retail Components on an External Computer to the Microsoft Dynamics AX R3 Azure Lifecycle Services Demo Virtual Machine Blog bot DAX Blogs 0 28.06.2014 00:13
Microsoft Dynamics CRM Team Blog: Understanding Storage and Storage Notifications in Microsoft Dynamics CRM Online Blog bot Dynamics CRM: Blogs 0 25.07.2013 08:12
dynamics-coe: Using Windows Azure Blog Storage with Dynamics CRM Blog bot Dynamics CRM: Blogs 0 11.02.2013 13:11
East Ocean - Technical: Working with ServiceConfiguration file in Azure Cloud Blog bot Dynamics CRM: Blogs 0 28.12.2011 13:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:59.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.