Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Database names with spaces cause firewall detection to fail - sqlcmd argument not quoted

Đang mở
#267 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@dzsquared đang làm issue này rồi.

Từ ngày 20/1/2026.

  • #268 của @dzsquared — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug

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()"
Ngôn ngữ chính
TypeScript
Star
142
Fork
73
Merge trung bình
3 ngày 3 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/sql-action

Tất cả issue của Azure/sql-action

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.