This project has moved. For the latest updates, please go here.

How to set up v4.1 plugin

  • Download v4.1 package and install the solution into CRM. Make sure you allow the plugin steps to be activated as well.
  • Open the plugin registration tool to edit plugin steps
  • Open each step, and make sure you have both the "Unsecure" and "Secure" configurations set. The "Unsecure" xml will already be there, you just need to change the values. You do need to create the "Secure" xml, fill in your storage account details and add it to each step (there's example xml in the solution, with comments on what to set) :
    • UnsecureConfiguration :
<Settings>
	<!-- Valid value(s) are "PluginStepConfigurationProvider". -->
	<Setting key="ConfigurationProviderType" value="PluginStepConfigurationProvider"/>
	<!-- Valid values are defined in StorageProviderType enum. -->
	<Setting key="Provider Type" value="AzureFile" />
	<!-- 
		Valid values are defined in CompressionProviderType enum.  
		Defaults to "PassThrough" if it doesn't exist 
	-->
	<Setting key="Compression" value="Zip" />
	<!-- 
		This value defines at what point compression is useful (Default 1).  
		Only used if "Compression" <> "PassThrough".
		Valid values are between 0 and 1.  
		0.95 for instance means the compressed file size must be 
		at least 5% smaller or else compression isn't used for the file.
	-->
	<Setting key="CompressionThreshold" value="0.95" />
	<!-- 
		Valid values are defined in EncryptionProviderType enum.  
		Defaults to "PassThrough" if it doesn't exist 
	-->
	<Setting key="Encryption" value="AES256" />
	<!-- 
		Valid values are defined in System.IO.Compression.CompressionLevel 
		enum.  
		Only used if "Compression" = "Zip". 
		Defaults to "Optimal" if it doesn't exist. 
	-->
	<Setting key="ZipCompressionLevel" value="Optimal" />
	<!-- 
		Root is the container name for "AzureBlob" 
		and share name for "AzureFile".
	-->
	<Setting key="annotationRoot" value="crm" />
	<!-- Optional folder path.  No leading/trailing / -->
	<Setting key="annotationFolder" value="annotations" />
	<!-- 
		Root is the container name for "AzureBlob" 
		and share name for "AzureFile".
	-->
	<Setting key="activitymimeattachmentRoot" value="crm" />
	<!-- Optional folder path.  No leading/trailing / -->
	<Setting key="activitymimeattachmentFolder" value="activitymimeattachments" />
</Settings>
  • SecureConfiguration
<Settings>
	<!-- Azure storage account name -->
	<Setting key="StorageAccount" value="" />
	<!-- Azure storage account key -->
	<Setting key="StorageKey" value="" />
	<!-- If "Encryption" = "AES256" then this is the encryption key used. -->
	<Setting key="AES256EncryptionKey" value="" />
	<!-- If "Encryption" = "AES256" then this is the salt used to hash encryption key with. -->
	<Setting key="AES256EncryptionKeySalt" value="" />
</Settings>
  • Once everything is setup, test by adding both a note attachment somewhere and an email attachment
    • You should be able to create, read (download/view) and delete these. Check that the changes are reflected in your azure storage account of choice.

Using IOrganizationService.LoadProperty api

  • The plugin works as is in the CRM user interface. However, if you are using the LoadProperty method from the API in code somewhere to load annotations/and or attachments, you need to do some extra work :
    • You need to attach the "Retrieve" message to the PARENT object you're calling "LoadProperty" from. Attach the "Retrieve" plugin to the "Retrieve" message on parent object, setting it to "Post-operation, Synchronous".

Last edited Nov 18, 2016 at 1:56 AM by dawidpotgieter, version 9