Has anyone succeeded getting files from this article? Following are stated: https://docs.microsoft.com/en-us/sharepoint/dev/apis/export-amr-api

using (Stream stmTemp = new MemoryStream())
    // Download current manifest file

    // Get IV and decrypt the content into output dir
    byte[] IV = Convert.FromBase64String(blob.Metadata[“IV”]);

    using (Stream targetStream = System.IO.File.Open(outputFileFullPath, FileMode.Append))
            using (Aes alg = new AesCryptoServiceProvider())
                stmTemp.Seek(0, SeekOrigin.Begin);
                using (CryptoStream csDecrypt = new CryptoStream(
                    alg.CreateDecryptor(key, IV),

However this key is not pressent on the blob: byte[] IV = Convert.FromBase64String(blob.Metadata[“IV”]);

And what is key? It is like a half sample of something not working :(

1 Answer 1


Guessing this is related to your earlier query of exporting documents out of SharePoint online to file share, but I can be wrong, ignore my comments in that case.

Migration API Read

Here is what I understood on this API. It is designed for ISVs (independent software vendors), who are creating tools for migrating data into SharePoint. The migration export API will help to get the metadata of list, document library, file, and folders to reduce the calls for incremental migration, after migration verification and permission settings.

This API performs a read operation of a provided URL and then Microsoft aggregates all the information into a designated manifest and move it to your Azure blob storage. ISVs can read back from the manifest and parse the metadata once it is ready.

To get the metadata they will first create a job by CreateSPAsyncReadJob function. Then you will have to decrypt (if encryptionOption is used) the manifest file to retrieve the metadata and use it for your verification, there is a way to query the job status to understand when the manifest is ready. It will not download your documents in the Azure blob storage.

When using the encryption parameter (while creating the job), the manifest will be encrypted at rest and the key will need to be preserved in order to read the logs and the real time progress. The main benefits is making the content useless for a malicious user who would manage to breach into the Azure container. Check the 'Encryption' sub menu on the API documentation to get details on the 'IV' and keys that are used for decryption.

I hope I am able to help here, but as stated earlier, I might be very wrong about your requirement with migration API. However, your question about exporting documents in large scale is very interesting and I will be grateful if you can share your solution once you find it.

  • Thanks for your response. I understand it could understand as related, but is not. However I found out the blobs are not encrypted. So I succedded getting the data. Apr 25, 2020 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.