Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Subfolders C# #2373

Closed
wrharper-AASP opened this issue May 9, 2023 · 2 comments
Closed

Feature: Subfolders C# #2373

wrharper-AASP opened this issue May 9, 2023 · 2 comments
Labels

Comments

@wrharper-AASP
Copy link

I'm not seeing a way to do this in C# and this appears to still be open since 2019: #1240
Since that one is specifcally about typescript which requires more resources at scale, I need to make this possible with C#.
https://dev.to/jfbrennan/the-reasons-i-don-t-use-typescript-2fhb
Lambda is actually slow, bad practice to rely on it too. Many reasons why this is not a good way to go.

Does anyone know of a way to do this yet with how C# works? The idea is something like ****.azurewebsites.net/Function1/USERID. So it needs to be dynamically checked and there does need to be 1 full URL per user. As you can imagine ****.azurewebsites.net/Function1/USERID is better than ****.azurewebsites.net/USERID because you could have thousands of functions depending on company scale. This isn't viable. This is now required due to a new system I'm using that will require 1 webhook per person.

@wrharper-AASP
Copy link
Author

I may have found a solution to this with routing:

[FunctionName("Function1")]
public static IActionResult Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "products/{category:alpha}/{id:int?}")] HttpRequest req,
string category, int? id, ILogger log)
{
    log.LogInformation("C# HTTP trigger function processed a request.");

    var message = String.Format($"Category: {category}, ID: {id}");
    return (ActionResult)new OkObjectResult(message);
}

I'll update this if this example works per: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?pivots=programming-language-csharp&tabs=python-v2%2Cin-process%2Cfunctionsv2#customize-the-http-endpoint

@wrharper-AASP
Copy link
Author

it is possible already, cancelling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant