Based on the issue you've described, it sounds like there might be an encoding issue with your run.cmd file. This can sometimes happen if the file is encoded in a format that Azure doesn't recognize, such as UTF-8 with BOM.
Here's a potential solution:
- Add a run.cmd file to your WebJob in Visual Studio (same place as your Program.cs)
- Make sure to set this file's 'Copy to Output Directory' to Copy if newer (in the file properties)
- In that file, just add one line that has: mywebjob.exe /dosomething Replace mywebjob.exe /dosomething with your own executable and parameters.
When deployed to Azure, this file will take precedence over the .exe, and will end up running the .exe with your parameters.
If this doesn't solve your issue, I'd recommend checking the encoding of your run.cmd files to ensure they're compatible with Azure. If you're using an editor like Visual Studio Code, you can check the encoding in the bottom-right corner of the window and change it if necessary. Try switching to UTF-8 without BOM if that's not the current encoding.