Azure / Azure/azure-functions-core-tools
Visual Studio template port confusion
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 14
Description
In Visual Studio 2022 creating a new Azure Function (Event Grid function in my case) the template for Function1 states port 7071:
```csharp
// Default URL for triggering event grid function in the local environment.
// http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.EventGrid;
using Microsoft.Extensions.Logging;
using Azure.Messaging.EventGrid;
namespace FunctionApp4
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([EventGridTrigger]EventGridEvent eventGridEvent, ILogger log)
{
log.LogInformation(eventGridEvent.Data.ToString());
}
}
}
```
But the actual port number is 7166 and randomly set when template is created and configured in launchsettings.json
```json
{
"profiles": {
"FunctionApp4": {
"commandName": "Project",
"commandLineArgs": "--port 7166",
"launchBrowser": false
}
}
}
```
Contributor guide
Research direction
Start with the Visual Studio Event Grid Function1 template and its generated launchsettings.json, comparing the documented webhook URL with the configured --port value. Trace how the template chooses or records the local port and check any related generation tests; done means the template's guidance matches the port used when the app runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- cli, developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100