【发布时间】:2020-04-26 10:21:34
【问题描述】:
我目前正在尝试将 Node JS 应用程序连接到我使用 Azure SQL 数据库创建的单个数据库。为了连接到数据库,我使用 Sequelize。为了做到这一点,我设置了防火墙以接受我的 IP 地址,如 here 解释的那样,我像这样配置了一个 config.json 文件
"username": "SERVER_ADMIN_NAME@MY_IP_ADDRESS",
"password": "ADMIN_PASSWORD",
"database": "DATABASE_NAME",
"host": "SERVER_NAME",
"port": 1433,
"dialect": "mssql",
"dialectOptions": {
"options": {
"encrypt": true
}
}
但是,在运行应用程序后,它无法连接到数据库并返回以下消息
"Cannot open server '211' requested by the login. Client with IP address 'MY_IP_ADDRESS' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect."
我已经等了超过 5 分钟,但结果还是一样。现在,我首先想到的是我如何为 config.json 文件提供值。但是,在使用以下查询检查sys.database_firewall_rules 后
SELECT * FROM sys.database_firewall_rules;
桌子是EMPTY。从这里开始,我真的不确定我应该做什么。我想知道是否有人能指出我错过了什么?提前致谢!
【问题讨论】:
标签: node.js azure sequelize.js azure-sql-database azure-sql-server