# How to launch multiple Azure Functions apps on different ports

Turns out setting up `Hosts.LocalHostPort` via local.settings.json doesn't work (consistently at least, I keep getting semi-random *Value cannot be null. (Parameter 'provider')* errors on function startup), [contrary to what the documentation says](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#local-settings-file). If you override the command line args directly, via a `launchSettings.json` , it works consistently and I even get faster startup ¯\_ (ツ)\_/¯:

```javascript
{
  "profiles": {
    "api": {
      "commandName": "Project",
      "commandLineArgs": "start --port 7072"
    }
  }
}
```

You might want to add a `--pause-on-error` in there too.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.cazzulino.com/azure/how-to-launch-multiple-azure-functions-apps-on-different-ports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
