Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CHALLENGE #6 – Access files stored in Azure Blob Storage (LEVEL 2)

Scenario

To surface a document library stored in Azure Blob Storage in Business Central. The documents only live in Azure Blob Storage but can be accessed through Business Central. The documents can be opened in the browser from an action.

To complete this challenge, you will need

  • A Dynamics 365 Business Central Sandbox Environment
    • Use http://aka.ms/bcsandbox to create an Azure VM if you do not have a sandbox environment.
  • Visual Studio Code with the AL Extension installed
    • Azure VMs will have VS Code pre-installed
  • The Url for an Azure Blob Storage with unauthenticated access
    • https://challenge6.blob.core.windows.net/files

 Expected result

Steps

  • Create an empty app
  • Create a new table with the relevant fields to describe an Azure Blob
  • Create a list page on top the new table. The table should be temporary.
  • Create a codeunit to encapsulate the access to Azure Blob Storage and a can populate the new table.
  • Add an action to the page that can open the selected document.

Hints

  • The documentation for Azure Blob Service REST API can be found here https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api. Look for the “List Containers” operation.
  • In VS Code, use Ctrl+Shift+P and type AL GO and remove the customerlist page extension
  • Use the ttable and the tfield snippets to create the table.
  • You can invoke the “List Container” Url directly in a browser to see the returned information.
  • Use the tpage and the tpagefield snippets to create the list page.
  • Use the tcodeunit snippet to create the codeunit.
  • Use the Hyperlink() method to open the document.

Cheat Sheets

  • Coming soon...

Happy coding

Esben Nyhuus Kristoffersen
Principal Achitect

Share the post

CHALLENGE #6 – Access files stored in Azure Blob Storage (LEVEL 2)

×

Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription

×