Skip to content
Troubleshooting cloud migration authentication error

Cloud Migration Replication fails with '401 - Client request has not been completed'

Daniel Gorski
Daniel Gorski June 06, 2024
3 min read

If you get the following error by using a delegated admin user on the customer's tenant:

"Client request has not been completed because it lacks valid authentication credentials for the requested endpoint(url)."

You should read this post.

What's happening? Read the general process or phases you go through to migrate data from on-premises to online here:

👉 Business Central on-premises to online migration - End-to-end overview

I've been using: IntegrationRuntime_5.41.8909.1

  • SQL credentials are valid and tested
  • Connection string works fine

Your SQL connection string should look like:

Server=<server>;Initial Catalog=<database>;User Id=<user>;Password=<pw>;

Use a SQL Server user, ideally sa or a dedicated migration account.

To test it with PowerShell:

$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = "Server=<server>;Initial Catalog=<database>;User Id=<user>;Password=<pw>;"
$connection.Open()
$connection.Close()

More troubleshooting info here:
👉 Troubleshooting the Cloud Migration - Microsoft Learn


✅ Solution

It does not work with an delegated admin account - even if that account got granted consent for cloud migration through page 40027.

I had to create a user on the customers tenant and assign a full bc user license - in that case a business central premium license.

It worked like a charm after repeating the cloud migration and using the new user.

Here is the full call stack:


Full Error Stack

Error message: Failed to prepare the systems for replication.
The call to prepare servers failed.
Run id='2fa85fef-be00-49a4-a0f8-f8dcb7528269',
Name='msweua1602t64662185_BCLast_Preparation',
ErrorMessage='Operation on target NotifyBusinessCentral failed: Invoking endpoint failed with HttpStatusCode - '401 : Unauthorized',
message - 'Client request has not been completed because it lacks valid authentication credentials for the requested endpoint(url).'

Internal session ID: 018d1a25-89fc-4eda-a3d7-39db1f87035a
Application Insights session ID: bcabf06c-fae8-44ae-8590-7a71a3fd31e2
Client activity id: 79fb8a43-141e-4b5e-aba5-1bcb3372ee80
Time stamp on error: 2024-06-05T18:09:35.5583917Z
User telemetry id: 7ce5c218-ad2f-48a1-9b58-7e5bc0d5f1c1

AL Call Stack

"Hybrid Deployment"(CodeUnit 6060).RetryGetStatus line 22 - Base Application by Microsoft
"Hybrid Deployment"(CodeUnit 6060).RetryGetStatus line 2 - Base Application by Microsoft
"Hybrid Deployment"(CodeUnit 6060).EnableReplication line 23 - Base Application by Microsoft
"Hybrid Cloud Management"(CodeUnit 4001).EnableReplication line 8 - Intelligent Cloud Base by Microsoft
"Hybrid Cloud Management"(CodeUnit 4001).HandleShowCompanySelectionStep line 8 - Intelligent Cloud Base by Microsoft
"Hybrid Cloud Setup Wizard"(Page 4000).ShowCompanySelectionStep line 5 - Intelligent Cloud Base by Microsoft
"Hybrid Cloud Setup Wizard"(Page 4000).NextStep line 40 - Intelligent Cloud Base by Microsoft
"Hybrid Cloud Setup Wizard"(Page 4000).NextStep line 30 - Intelligent Cloud Base by Microsoft
"Hybrid Cloud Setup Wizard"(Page 4000)."ActionNext - OnAction"(Trigger) line 35 - Intelligent Cloud Base by Microsoft

Related posts

▸ All posts
BeyondCues Subscription Billing KPIs in Business Central

Product

Subscription Billing KPIs in Business Central

March 07, 2026 · Daniel Gorski

MRR, ARR, ARPU and churn rate as cue tiles in the Business Central Role Center, straight from Subscription Billing data, without writing AL code.

Read More
Read More: Subscription Billing Meets Real-Time KPIs: BeyondCues Sub. Billing
Modular ERP architecture for scalable enterprise software

Why ERP Only Scales When It's Built Modular

December 04, 2025 · Daniel Gorski

ERP should be a stable backbone, yet many projects end in rigid structures and costly customizations. Why small, exchangeable apps make ERP scalable.

Read More
Read More: Why ERP Only Becomes Truly Scalable When Built Modularly
Beyond Cues update with new features for Business Central KPI dashboards

Beyond Cues 2025 Update: New Features

October 03, 2025 · Daniel Gorski

Beyond Cues update for Business Central: cues that handle uninstalled extensions, faster processing, a new percentage calculation and seven new languages.

Read More
Read More: Beyond Cues Just Got Better: New Features and Performance Boosts