You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I created a repo from the template and then cloned it to my local machine I was not able to hit the API endpoint in the functions app.
I need to update the appsettings.Development.json file with { "BaseAddress": "http://localhost:7071/" }
Then I also needed to update the Program.cs file with var baseAddress = builder.Configuration["BaseAddress"] ?? builder.HostEnvironment.BaseAddress; builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(baseAddress) });
replacing builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) })
Basically copying from the previous / older template
Then I was able to get the data from the function app when I navigated to the fetchdata page
I also needed to add the Shared project as it was not included in the solution when I opened it in VS
(it was in the cloned repo, just not referenced in the solution when I opened it)
The text was updated successfully, but these errors were encountered:
When I created a repo from the template and then cloned it to my local machine I was not able to hit the API endpoint in the functions app.
I need to update the appsettings.Development.json file with
{ "BaseAddress": "http://localhost:7071/" }
Then I also needed to update the Program.cs file with
var baseAddress = builder.Configuration["BaseAddress"] ?? builder.HostEnvironment.BaseAddress; builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(baseAddress) });
replacing
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) })
Basically copying from the previous / older template
Then I was able to get the data from the function app when I navigated to the fetchdata page
I also needed to add the Shared project as it was not included in the solution when I opened it in VS
(it was in the cloned repo, just not referenced in the solution when I opened it)
The text was updated successfully, but these errors were encountered: