Publishing an ASP.NET Core web app to Azure with database migrations fails with the following error in Visual Studio
Web deployment task failed. (Make sure the database connection string for the server is correct and that you have appropriate permission to access the database. (Web Deploy Provider is "dbFullSql").
Error details:Could not complete an operation with the specified provider ("dbFullSql") when connecting using the Web Management Service. This can occur if the server administrator has not authorized the user for this operation. dbFullSql http://go.microsoft.com/fwlink/?LinkId=178034 Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_AUTHORIZED_FOR_DBFULLSQL.)
From the cmd line:
msbuild /p:DeployOnBuild=true /p:PublishProfile=Staging /p:Configuration=Release /p:Username=xxx /p:Password=xxx
_GenerateEFSQLScripts:
Generating Entity framework SQL Scripts...
Executing command: dotnet ef migrations script --idempotent --output "C:\Dev\Neptune.Core\Neptune.Web\obj\Release\netcoreapp2.
1\PubTmp\EFSQLScripts\Neptune.Web.Data.ApplicationDbContext.sql" --context Neptune.Web.Data.ApplicationDbContext
Generating Entity framework SQL Scripts completed successfully
_PrepareForMsDeployPublish:
Deleting file "C:\Dev\Neptune.Core\Neptune.Web\obj\Release\netcoreapp2.1\PubTmp\Neptune.Web.SourceManifest.xml".
Deleting file "C:\Dev\Neptune.Core\Neptune.Web\obj\Release\netcoreapp2.1\PubTmp\Neptune.Web.Parameters.xml".
Creating "C:\Dev\Neptune.Core\Neptune.Web\obj\Release\netcoreapp2.1\PubTmp\Neptune.Web.SourceManifest.xml" because "AlwaysCrea
te" was specified.
Creating "C:\Dev\Neptune.Core\Neptune.Web\obj\Release\netcoreapp2.1\PubTmp\Neptune.Web.Parameters.xml" because "AlwaysCreate"
was specified.
MSDeployPublish:
Starting Web deployment task from source: manifest(C:\Dev\Neptune.Core\Neptune.Web\obj\Release\netcoreapp2.1\PubTmp\Neptune.We
b.SourceManifest.xml) to Destination: auto().
Adding sitemanifest (sitemanifest).
Adding database ()
C:\Program Files\dotnet\sdk\2.1.300\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish
.MSDeploy.targets(139,5): error : Web deployment task failed. (Make sure the database connection string for the server is correc
t and that you have appropriate permission to access the database. (Web Deploy Provider is "dbFullSql"). [C:\Dev\Neptune.Core\Ne
ptune.Web\Neptune.Web.csproj]
C:\Program Files\dotnet\sdk\2.1.300\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish
.MSDeploy.targets(139,5): error : Error details:Could not complete an operation with the specified provider ("dbFullSql") when c
onnecting using the Web Management Service. This can occur if the server administrator has not authorized the user for this oper
ation. dbFullSql http://go.microsoft.com/fwlink/?LinkId=178034 Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERR
OR_USER_NOT_AUTHORIZED_FOR_DBFULLSQL.) [C:\Dev\Neptune.Core\Neptune.Web\Neptune.Web.csproj]
Publish failed to deploy.
0 Warning(s)
1 Error(s)
Here's the weird thing its works fine if I comment out the local database connection string and apply the update directly using the connection string to the Azure SQL database (ie connect to the database directly in code):
C:\Dev\Neptune.Web>dotnet ef database update
Applying migration '20180613012042_CreateDate'.
Done.
Things I've done/checked:
msbuild /version output:
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
15.7.179.6572
OS info:
Windows 10
dontnet --version
2.1.300
i ended up here while trying to solve the same error message. The reason i got this same error was that i checked apply migrations but didnt' provide the connection string to the azure sql db. Once i grabbed that from Azure and put it in, the publish worked for me.

This is not the right repo for this issue.
To Get the quickest answer to your questions, please file a VS Feedback ticket and this issue will be triaged to the appropriate team.
i ended up here while trying to solve the same error message. The reason i got this same error was that i checked apply migrations but didnt' provide the connection string to the azure sql db. Once i grabbed that from Azure and put it in, the publish worked for me.
Thank you!
i ended up here while trying to solve the same error message. The reason i got this same error was that i checked apply migrations but didnt' provide the connection string to the azure sql db. Once i grabbed that from Azure and put it in, the publish worked for me.
Thanks u save me
Most helpful comment
i ended up here while trying to solve the same error message. The reason i got this same error was that i checked apply migrations but didnt' provide the connection string to the azure sql db. Once i grabbed that from Azure and put it in, the publish worked for me.
