Azure发布:用户"xxxxxx"的登录失败 [英] Azure publish: Login failed for user 'xxxxxx'

查看:159
本文介绍了Azure发布:用户"xxxxxx"的登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将.NET后端用于Azure移动应用程序.我一直在为我的数据库使用Code-First迁移,并且到目前为止进行了许多迁移和发布. 一切都很好,顺利.然后,我决定从Azure门户重置我的SQL Server密码.之后事情开始往南走.

I am using .NET backend for my Mobile App of Azure. I have been using Code-First migrations for my database and done many migrations and publishes so far. Everything was nice and smooth. Then I decided to reset my SQL Server password from Azure portal. After that things started to go south.

更改密码后我遇到的问题:

The problems that I faced after password change:

1-当我在Package Manager控制台中尝试Add-Migration blabla时,Visual Studio告诉我必须先应用以前的所有迁移.

1- When I tried Add-Migration blabla in Package Manager Console, Visual Studio told me that all my previous migrations must be applied first.

2-我尝试了Update-Database.这次我出现了Login failed for user 'xxxxxx'错误.

2- I tried Update-Database. This time I got the Login failed for user 'xxxxxx' error.

此错误之后,我将密码设置为与Azure门户中的旧密码相同. 这使我能够再次从控制台进行迁移.但是在迁移后,当我尝试使用代码Publish时,又得到了以下屏幕.

After this error, I set my password the same as the old one from Azure portal. This has allowed me to make migrations from console again. But after migration, when I trıed to Publish my code, I got the following screen again.

要解决此问题,我做了以下事情:

To fix this, I did the following:

1-检查了我的ConnectionString,它是正确的.这是Azure中显示的数据库的ConnectionString

1- Checked my ConnectionString and it is correct. Here is the ConnectionString of my database shown in Azure

这是我的ConnectionString,位于Web.Config文件中.

And here is my ConnectionString which is located in Web.Config file.

<connectionStrings> <add name="MS_TableConnectionString" connectionString="Server=tcp:xxxxxx.database.windows.net,1433;Initial Catalog=xxxxxxDatabase;Persist Security Info=False;User ID=xxx@xxxxxx; Password=xxxxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" providerName="System.Data.SqlClient" /> </connectionStrings>

<connectionStrings> <add name="MS_TableConnectionString" connectionString="Server=tcp:xxxxxx.database.windows.net,1433;Initial Catalog=xxxxxxDatabase;Persist Security Info=False;User ID=xxx@xxxxxx; Password=xxxxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" providerName="System.Data.SqlClient" /> </connectionStrings>

2-我尝试设置Persist Security Info=TrueTrustServerCertificate=True.

2- I have tried set Persist Security Info=True and TrustServerCertificate=True.

3-我从Azure门户重置了我的移动应用发布配置文件.

3- I reseted my Mobile App publish profile from Azure Portal.

这些都没有为我工作.我仍然收到相同的错误屏幕. 我该怎么办?

None of these have worked for me. I am still getting the same error screen. What can I do?

注意:当我从Visual Studio开始本地调试时,我会获得正确的您的移动应用已启动并正在运行"页面.

在发布设置中,验证连接"和测试连接"也会返回肯定的结果.

其他信息:

  • 如果这在某些方面很重要,那么过去两周我都没有使用过迁移.

  • I have not used migrations for last two weeks, if this is important somehow.

我能够从SSMS查看数据库的内容.

I am able to view contents of my database from SSMS.

(很抱歉,问题太长,格式有些偏离.我没问过很多问题)

(Sorry if the question is too long and format is a little bit off. I haven't asked many questions)

推荐答案

像往常一样,这是一个非常简单的错误,它花费了很多时间.原来Visual Studio的一部分,我的ConnectionStrings是正确的.但是,由于某些原因,Azure门户中的移动应用程序仅在首次更改密码时才进行了更新.您必须在应用程序设置中检查ConnectionString.

As usual, it is a very simple mistake that consumed so much time. Turns out Visual Studio part and my ConnectionStrings were correct. However, for some reason Mobile App in Azure Portal has been updated only for the first password change. You must check the ConnectionString in application settings.

结论,如果在发布时设法验证来自Visual Studio的连接,请在出现此错误时始终检查Azure Portal设置.

Conclusion, if you manage to validate connections from Visual Studio while publishing, always check Azure Portal settings if you get this error.

这篇关于Azure发布:用户"xxxxxx"的登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆