Database names with spaces cause firewall detection to fail - sqlcmd argument not quoted
评估
这个 Issue 还没有评估数据。
描述
When the connection string contains a database name with a space (e.g. Initial Catalog=MyDatabase Live), the firewall IP detection step fails because the database name is not properly quoted when passed to sqlcmd.
Error:
Failed to add firewall rule. Unable to detect client IP Address. Sqlcmd: 'Live': Unknown command. Enter '--help' for command help.
Debug output:
##[debug]Validating if client has access to 'MyDatabase Live' on 'myserver.database.windows.net'.
##[debug]The process 'sqlcmd' failed with exit code 1
##[debug]SqlCmd stderr: Sqlcmd: 'Live': Unknown command. Enter '--help' for command help.
The action correctly parses the database name as MyDatabase Live, but fails to quote it when executing sqlcmd.
Environment:
azure/[email protected]runs-on: ubuntu-latest- Azure SQL Database with
Authentication=Active Directory Default
Connection string:
Server=myserver.database.windows.net;Initial Catalog=MyDatabase Live;Authentication=Active Directory Default;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
Attempted workarounds (none worked):
- Single quotes:
Initial Catalog='MyDatabase Live' - Double quotes:
Initial Catalog="MyDatabase Live"
Potential root cause:
The detectIPAddress function extracts the database name correctly but may pass it to sqlcmd as the -d argument without quoting, resulting in:
sqlcmd -S myserver.database.windows.net -d MyDatabase Live -Q "select getdate()"
Expected behaviour:
sqlcmd -S myserver.database.windows.net -d "MyDatabase Live" -Q "select getdate()"
- 主要语言
- TypeScript
- 星标
- 142
- 派生
- 73
- 平均合并
- 3 天 3 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/sql-action 的其他 Issue
-
need-to-triage
难度 1/5 1 小时以内 新手友好度 62/100
Azure/sql-action#247 ·
-
need-to-triage
难度 3/5 1-2 天 新手友好度 65/100
Azure/sql-action#282 ·
-
need-to-triage
难度 3/5 1-2 天 新手友好度 45/100
Azure/sql-action#262 · 2 条评论 ·
-
need-to-triage
难度 3/5 1-2 天 新手友好度 35/100
Azure/sql-action#261 ·
-
need-to-triage
难度 4/5 3-5 天 新手友好度 48/100
Azure/sql-action#256 · 1 条评论 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
Agenta-AI/agenta#7542 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
code quality security
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 90/100
-
难度 1/5 1 小时以内 新手友好度 82/100
homarr-labs/dashboard-icons#2939 ·
维护者通常 1 天内回复