You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用mssql-scripter备份Azure AD认证数据库对象遇登录失败问题

问题原因与解决方案

mssql-scripter支持Azure Active Directory(AD)认证,并非只能用Windows认证,你的操作错误在于未指定正确的Azure AD认证方式,导致工具误解析了登录凭证。

错误原因

当你用-U传递Azure AD邮箱格式的用户名、-P传递密码时,工具默认采用SQL Server身份认证逻辑处理,误将邮箱中的域名部分(my_mail_domain)识别为目标服务器名称,从而抛出"无法打开服务器'my_mail_domain'"的登录失败错误。

正确操作方式

根据你的Azure AD认证类型,选择对应命令:

1. Azure AD密码认证

添加--authentication-method ActiveDirectoryPassword参数明确认证方式,完整命令示例:

mssql-scripter -S server.database.windows.net -d database -U user@domain.com -P password -f destination --file-per-object --authentication-method ActiveDirectoryPassword

2. Azure AD集成认证

如果你的本地Windows账号已关联Azure AD身份,可直接使用集成认证,无需输入密码:

mssql-scripter -S server.database.windows.net -d database -f destination --file-per-object --authentication-method ActiveDirectoryIntegrated

注意:Azure SQL服务器地址需填写完整的FQDN(格式如xxx.database.windows.net),不能仅简写服务器名。

内容的提问来源于stack exchange,提问作者Tempei4

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 18:15:49