0

I have an API written in dotnet 7 that I want to deploy on a linux service app. I specified a startup script because I need to install dependencies before. The problem is that my script is ignored. If I try to put the service app in net 6 it works very well.

enter image description here

dna
  • 486
  • 1
  • 9
  • 18

1 Answers1

0

I tried to execute the sample script with dotnet 7 as a runtime stack and published through visual studio as follows and was able to deploy and run the script correctly.

Shell Script: run.sh

enter image description here

Build & published to azure portal successfully:

enter image description here

Web App after successful deployment:

enter image description here

App Services -> WebApp -> settings -> configuration -> General settings:

enter image description here

Add filename/path in startup command and save the configuration settinsg. (run.sh is my filename) Now, visitApp Services -> WebApp -> Development tools -> SSH& check whether the script is running.

enter image description here

Note: As there is no issue with the "dotnet versions (7.0)", try checking your commands in a shell script and execute them again. Before running the script, make sure that the "startup command" section in the Web App -> configuration setup contains the correct file path.

Refer SO by @HeyMan for relevant issue.

Jahnavi
  • 3,076
  • 1
  • 3
  • 10
  • I put jsute run.sh in the start command but it’s not price in account. My app service is on Linux – dna Jan 16 '23 at 08:15
  • The command generated is: Running oryx create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -defaultAppFilePath /defaulthome/hostingstart/hostingstart.dll --bindPort 8080 -bindPort2 -userStartupCommand 'run.sh' The script is ignored. I don’t even have a message that it doesn’t find it. It gets urgent I’m really blocked – dna Jan 18 '23 at 09:33
  • Did you check the logs? – Jahnavi Jan 18 '23 at 10:12
  • Yes I checked the logs. It is not running. It directly tries to start my application – dna Jan 18 '23 at 10:13
  • Try running in different port! – Jahnavi Jan 18 '23 at 10:16
  • How do we do this, please? – dna Jan 18 '23 at 10:17
  • Can you [check](https://linuxconfig.org/how-to-change-ssh-port-on-linux) this? This works for you. – Jahnavi Jan 18 '23 at 10:19
  • I am error : sudo command not found – dna Jan 18 '23 at 10:22
  • When system doesn't have sudo utility installed, Goto rootusermode install it. [Refer](https://www.bing.com/ck/a?!&&p=878a982e2c50f4f5JmltdHM9MTY3NDAwMDAwMCZpZ3VpZD0xMjVhNTgzNy01ZWY1LTZlZDMtMzA0YS00YTM4NWZhNzZmZTUmaW5zaWQ9NTQ2Nw&ptn=3&hsh=3&fclid=125a5837-5ef5-6ed3-304a-4a385fa76fe5&psq=sudo+command+not+found&u=a1aHR0cHM6Ly9pdHNsaW51eGZvc3MuY29tL3N1ZG8tY29tbWFuZC1ub3QtZm91bmQvIzp-OnRleHQ9VGhlJTIwcHJvYmxlbSUyMHN0YXRlbWVudCUyMCVFMiU4MCU5Q3N1ZG8lMjBjb21tYW5kJTIwbm90JTIwZm91bmQlRTIlODAlOUQlMjBvY2N1cnMsaW5zdGFsbGluZyUyMHRoZSUyMHN1ZG8lMjB0b29sJTIwdXNpbmclMjB0aGUlMjBhcHQlMjByZXBvc2l0b3J5Lg&ntb=1). – Jahnavi Jan 18 '23 at 10:31
  • Refer [SO](https://stackoverflow.com/questions/12996397/command-not-found-when-using-sudo) if required. – Jahnavi Jan 18 '23 at 10:35
  • I played this command chmod u+x on the file and added the line #!/bin/sh but nothing does. I still have the same command to launch and therefore not taken into account – dna Jan 18 '23 at 11:09