How to call Site.ProvisionMigrationContainers()?

When I call this method it returns an empty list, when it should not. It returns immediately, which is indicative of the fact that it did nothing. What is the procedure to execute this method?

EDIT: I'm using c#

  • What are you using? C# or JavaScript? JSOM, CSOM, SSOM?
    – helb
    Nov 7, 2018 at 15:32
  • documentation says it puts an item on a queue: msdn.microsoft.com/en-us/library/… Nov 7, 2018 at 15:52
  • It initilizes the Azure Containers and returns their urls so that you can put items on the queue with CreateMigrationJob
    – user77232
    Nov 7, 2018 at 18:31

1 Answer 1


Sigh, I figured it out. I had to use Jetbrains dotPeek to look at the code for the SharePoint.Client library.

        public static ClientResult<ProvisionedMigrationContainersInfo> GetContainer() {
        Uri _targetUrl = new Uri("https://companyname.sharepoint.com/sites/MySite"); //target sharepoint online site

        ClientContext _context = new ClientContext(_targetUrl);
        //look up credentials in windows credential store, not necessary for hard coded passwords
        Credential _creds = new Credential() { Target = "companyname.sharepoint.com" };
        if (_creds.Exists()) {
        else {
            throw new ApplicationException("Credentials Not Found");
        _context.Credentials = new SharePointOnlineCredentials(_creds.Username, _creds.SecurePassword);
        //make the call to the method. The method returns an object with the value property unpopulated.
        ClientResult<ProvisionedMigrationContainersInfo> _migrationContainers = _context.Site.ProvisionMigrationContainers();
        //which only gets populated after ExecuteQuery
        //the urls are now populated
        return _migrationContainers;

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.