Skip to content

Migration API CreateMigrationJob failed for GCC azure storage  #6780

@hualala1212

Description

@hualala1212

Category

  • Bug

Describe the bug

We use CreateMigrationJob to start migration job to import data to our sharepoint site, since auzre storage is govenment gcc, which endpoint suffix is "blob.core.usgovcloudapi.net", but it failed with could not resolve remote name "core.windows.net" which is global azure storage endpoint suffix.

Microsoft.WindowsAzure.Storage.StorageException: The remote name could not be resolved: 'spc.queue.core.windows.net' ---> System.Net.WebException: The remote name could not be resolved: 'spc.queue.core.windows.net'

We passed right azure storage container and queue uri, but this API failed to differentiate it.

Steps to reproduce

sample program

those are some filecontaineruri, packagecontaineruri and report queueuri sample we
/*
https://spc.blob.core.usgovcloudapi.net/migration-files1cfb064b-aa77-4bd7-b329-1b1e452c6365?sv=2015-02-21&sr=c&sig=Vdb9cSaAboMIMmRc5Ul94M6xkh1O/ybapNArRvtHJ0w=&se=2021-03-20T21:40:38Z&sp=rl
https://spc.blob.core.usgovcloudapi.net/cvspmigrationfiles111cfb064b-aa77-4bd7-b329-1b1e452c6365?sv=2015-02-21&sr=c&sig=JrXeDqmyhSbxKcVobXXqouSFZn+EbjMupSZFgsNqkTE=&se=2021-03-20T21:40:38Z&sp=rwl
https://spc.queue.core.usgovcloudapi.net/migrationqueue1cfb064b-aa77-4bd7-b329-1b1e452c6365?sv=2015-02-21&sig=MpoecpBitFJLjxRFbqD5vFdwwCepcYMoqp1wpEikbSw=&se=2021-03-20T21:40:38Z&sp=raup
*
*/

public void StartMigrationJob()
{
string office365UserName = "";
string offfice365Password = "";
string siteurl = "";
string fileContainerUri = "";
string packageContainerUri = "";
string reportingQueueUri = "";

        try
        {
            SecureString sPassWord = new SecureString();

            foreach (char c in offfice365Password.ToCharArray())
            {
                sPassWord.AppendChar(c);
            }
  
            ClientContext clientContext = new ClientContext(siteurl);
            clientContext.Credentials = new SharePointOnlineCredentials(office365UserName, sPassWord);

            Site m_site = clientContext.Site;
            clientContext.Load(m_site);
            clientContext.ExecuteQuery();

            Web m_web = clientContext.Web;
            clientContext.Load(m_web);
            clientContext.ExecuteQuery();

            m_site.CreateMigrationJob(m_web.Id, fileContainerUri, packageContainerUri, reportingQueueUri);
            clientContext.ExecuteQuery();
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }

}

Expected behavior

it should allow migration job created for gcc azure storage.

Environment details (development & target environment)

N\A

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APIstatus:to-be-reviewedIssue needs to be reviewed by Microsoft for additional follow up / review.type:archive-old-issueIssues which are closed as tool old for active worktype:questionQuestion... if answered, will be tagged as such.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions