Enable Azure Storage

Azure Storage integration for portals enables you to take advantage of the greater file storage capability of Azure, using the same interface and providing the same user experience as for default file attachments. This feature is supported for web files, entity forms, and web forms.

You must create a storage account with Resource manager as the deployment model. More information: Create an Azure storage account.

After the storage account is running, portals require certain global settings that tell the application how to locate your storage account. From Dynamics 365, go to Settings > Portal Settings, and add a new setting named FileStorage/CloudStorageAccount.

To locate the value for FileStorage/CloudStorageAccount, you must get a connection string from your Azure portal.

  1. Sign in to your Azure portal.

  2. Navigate to your storage account.

  3. Select Access Keys.

    Locate value for connection string from your Azure portal

  4. In the resulting panel, locate the field labeled Connection String. Select the Copy icon next to the field for which you need to copy the value, and then paste that value into your new setting:

    Primary connection string value

    Portal setting for cloud storage account

Specify the storage container

If you do not already have an Azure Blob container in your storage account, you must add one by using your Azure portal.

From Dynamics 365, go to Settings > Portal Settings, and add a new setting named FileStorage/CloudStorageContainerName, using the name of your container as the value.

Portal setting for cloud storage container

Add CORS rule

You must add cross-origin resource sharing (CORS) rule on your Azure Storage account as follows, otherwise you will see the regular attachment icon rather than the cloud icon:

  • Allowed origins: Specify your Dynamics 365 domain. For example, contoso.crm.dynamics.com.
  • Allowed verbs: GET, PUT, DELETE, HEAD, POST
  • Allowed headers: Specify the request headers that the origin domain may specify on the CORS request. For example, x-ms-meta-data*, x-ms-meta-target*.
  • Exposed headers: Specify the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. For example, x-ms-meta-*.
  • Maximum age (seconds): Specify the maximum amount time that a browser should cache the preflight OPTIONS request. For example, 200.

More information: CORS support for the Azure Storage Services

With these settings, your portal capabilities for Dynamics 365 application is ready to begin uploading and downloading files to and from Azure Storage. However, you cannot take full advantage of this feature until you add a web resource to enable uploading attachments to Azure Storage, and configure entity forms or web forms to use it.