Search code examples
azureazure-functionsspring-native

Azure Functions with docker: How change port?


I have built a docker image using Spring Native. The Spring Boot application inside the container listens on port 80 but crashes on Azure Functions on startup because of missing access rights (it seems docker doesn't allow usage of ports bellow 1024). How can I change the port Azure Functions uses for accessing the application inside the docker image?


Solution

  • If you are using 80 or 8080, azure will auto-detect the used port.

    Every other port can be configured using WEBSITES_PORT environment variable "Function App -> Settings -> Configuration -> New application settings" to something like 8081 (or that one, which the app listens on).