i'm currently migrating azure function from .net core 3.1 to .net 7, use isolated process, my current code ( .net 3.1 and in-process function ) as below
> [FunctionName("ResetMyState")]
> public async Task<HttpResponseMessage> ResetMyState(
> [HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestMessage req,
> [DurableClient] IDurableClient client,
> ILogger log)
> {
> // Get the connection string from app settings
> string connString = this._nameResolver.Resolve("AzureStorage");
> var settings = new AzureStorageOrchestrationServiceSettings
> {
> StorageConnectionString = connString,
> **TaskHubName = client.TaskHubName,**
> };
> // business code here
> return req.CreateResponse(System.Net.HttpStatusCode.OK); }
Is there any similar way that lets me take the TaskHubName in .net 7 isolated function ? and another thing is as I know Isolated function only support HttpRequest/ResponseData but the existing code's using HttpRequest/ResponseMessage, will it still work as expected or I need to change that as well ?
Thank you. Dan
Yes, you can take the hubName in the
host.json
orlocal.settings.json
file. Please refer ms docs for more details.I am getting the results while hitting the urls given here using hubname and connection string declared in my
host.json
file.Use
HttpResponseData
instead ofHttpResponseMessage
for isolated process as shown below