Which format is required for the bootstrap file if my on-premises device runs Windows?

更新时间:
复制 MD 格式

The bootstrap file must use Unix (Uniplexed Information and Computing Service) format, which means line endings must be LF (\n). Windows uses CRLF (\r\n) line endings by default, which the Linux execution environment of Function Compute cannot parse, causing the function to fail at startup.

Convert the bootstrap file to Unix format

Use one of the following methods on Windows:

MethodSteps
WSL (Windows Subsystem for Linux)Edit and save the file directly in WSL. Files saved in WSL use LF by default.
Git BashOpen the file in Git Bash and run sed -i 's/\r//' bootstrap.
VS CodeOpen the file, click CRLF in the bottom-right status bar, select LF, then save.
Notepad++Go to Edit > EOL Conversion > Unix (LF), then save.

Verify the line ending format

After conversion, run the following command in WSL or Git Bash to confirm the file uses LF:

file bootstrap

The output should include ASCII text without with CRLF line terminators. If CRLF is still present, repeat the conversion.

If the bootstrap file uses Windows line endings (CRLF), Function Compute returns an error when invoking the function. Convert the file to Unix format before deploying.