简体   繁体   中英

ERROR_USER_NOT_AUTHORIZED_FOR_DBFULLSQL during publishing

I have published my asp core website on smarteasp hosting. However I have found the problem that my local db has been not transfered so pages, where interectations with db are required, give me a error. Then I uploaded my db .mdf file and even been able to see tables and data on hosting panel page. However my site still works incorrect in those parts where interactions with db are required (while on my local all works correct).

So I decided to change my Web Deploy publish setting to include "Apply this migration on publish" and choose my migration named "Initial". Then even in preview menu all looks correct.

However when I push publish button I get ERROR_USER_NOT_AUTHORIZED_FOR_DBFULLSQL . I have been looking many links related to this error including official ones https://www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codes#ERROR_USER_NOT_AUTHORIZED_FOR_DBFULLSQL but no one of them give me any understanding of sources and solution to this error.

So my primary question is how to resolve this error. Additionally I'd like to know if the inclusion of migration during web deployment could resolve the problem I described in the first paragraph.

The biggest problem with this error is the description of the error message. If you try to read the linked messages, you'll definitely go down the wrong path. I tried to setup user permissions all over my Azure site to no avail.

The problem is actually fairly easy to replicate. If you delete your Web Deployment profile, then let publish create your profile by using the Microsoft Azure App Service button, you'll encounter this error.

Attempting to publish to Azure with the DefaultConnection set to the local connection string, you'll get the ERROR_USER_NOT_AUTHORIZED_FOR_DBFULLSQL error message

Server=(localdb)\mssqllocaldb;Database=aspnet-WebApplication1;Trusted_Connection=True;MultipleActiveResultSets=true

So the solution is to go to Azure and copy the correct connecting string and update your profile. I've asked Microsoft technical support to update the web page describing the error, or at best add a new error code.

I encountered this error when using msdeploy to publish a web deploy package to Azure. The error was caused by the use of a wrong connection string in file .SetParameters.xml. A connection string with a parameter name ending with "-Web.config Connection String" was used in the parameters file. This connection string is however intended for the web app itself. The error was solved after setting the deployment connection string, using a parameter name ending with "-Deployment Connection String".

In appsettings.json I have changed DefaultConnection string to the one that represents host database settings including password ( do not forget to set it in this string after your host provide it to you as he often writes ***** or YOUR_PASSWORD where your password should be placed). So it should look something like

"DefaultConnection": "Some code that your host should give to you;MultipleActiveResultSets=True;"

Also I put this string (Withot DefaultConnection) when I publish in database checkbox.

Make sure to not deploy migrations. Migrations requires full database control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM