Skip to content

Commit c9b222f

Browse files
JoanneHendricksonVesaJuvonen
authored andcommitted
Update export-amr-api.md (SharePoint#5137)
added code sample on how to retrieve and decipher manifest
1 parent 4a216fa commit c9b222f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/apis/export-amr-api.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Below is an example on how to query the folder:
172172
CloudBlobDirectory folder = blobContainerObj.GetDirectoryReference(jobid);
173173
CloudBlockBlob blob = folder.GetBlockBlobReference(manifestFileName);
174174

175+
175176
|**XML file**|**Schema File**|**Description**|
176177
|:-----|:-----|:-----|
177178
|ExportSettings.XML|DeploymentExportSettings Schema|ExportSettings.XML does the following:</br></br>- Contains the export settings specified by using the SPExportSettings class and other classes that are part of the content migration object model. </br></br>- Ensures that the subsequent export process (at the migration target site) enforces the directives specified in the export settings.</br></br>- Maintains a catalog of all objects exported to the migration package.|
@@ -183,6 +184,41 @@ Below is an example on how to query the folder:
183184
|UserGroupMap.XML|DeploymentUserGroupMap Schema|Provides validation for the UserGroup.xml file exported into the content migration package. UserGroup.xml maintains a list of users and user security groups with respect to access security and permissions.|
184185
|ViewFormsList.XML|DeploymentViewFormsList Schema|Provides validation for the ViewFormsList.xml file exported into the content migration package.ViewFormsList.xml maintains a list of Web Parts and tracks whether each is a view or form.|
185186

187+
#### How to retrieve the manifest from the Azure blob
188+
189+
The following example code demonstrates how to get the Azure blob of an manifest file and decipher it:</br></br>
190+
191+
```XML
192+
193+
// Get Azure blob of a manifest file
194+
CloudBlockBlob blob = folder.GetBlockBlobReference(blobName);
195+
blob.FetchAttributes();
196+
197+
using (Stream stmTemp = new MemoryStream())
198+
{
199+
// Download current manifest file
200+
blob.DownloadToStream(stmTemp);
201+
202+
// Get IV and decrypt the content into output dir
203+
byte[] IV = Convert.FromBase64String(blob.Metadata[“IV”]);
204+
205+
using (Stream targetStream = System.IO.File.Open(outputFileFullPath, FileMode.Append))
206+
{
207+
using (Aes alg = new AesCryptoServiceProvider())
208+
{
209+
stmTemp.Seek(0, SeekOrigin.Begin);
210+
using (CryptoStream csDecrypt = new CryptoStream(
211+
stmTemp,
212+
alg.CreateDecryptor(key, IV),
213+
CryptoStreamMode.Read))
214+
{
215+
csDecrypt.CopyTo(targetStream);
216+
}
217+
}
218+
}
219+
}
220+
221+
```
186222
#### JobQueueUri
187223

188224
public Uri JobQueueUri { get; set; }

0 commit comments

Comments
 (0)