AXGuru D365-Commerce
Devices In Dynamics 365 Commerce
April 10, 2020

Upload file to Azure blob – D365

Upload file to Azure BLOB - D365

Upload file to Azure BLOB storage using Dynamics 365

File path can be different according to the scenarios. In my case I have attached a file to a sales order. Following are the steps mentioned below.

Step 1: 

Add an attachment to the sales order. 

File has been attached to the sales order.

Step 2:

Code to upload the attached file to the azure blob storage.

Firstly, we need to have credentials of the azure storage. On the Azure portal we can find the credentials on the following navigation. 
Home > Resource groups > select resource group > storage account > select storage account

Under Settings section, click on Access keys to get the credentials of storage account.

Note: We can upload file to azure blob using connection string or using key and storage account name. Code is same for both with some differences.

Upload file using connection string:

Upload file using storage account and key:

Rest of the code is same.

Now, run the job. 

File successfully uploaded to azure blob storage. 

Go to your storage account > Blob service > Containers

Now, click on the testingcontainer. It will show all the blob files that are saved in it. 

We can now download this file.

For any further information
Saeed ur Rehman
Saeed ur Rehman
Dynamics AX/365 developer