0

Making sure that you have all the following done: https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-8/

If you create a new Project in VS 2019 and use the Hosted Blazor template and then without modification (once you have it building and working on your local machine) Publish it to Azure. You will see that when you go to the fetchdata page, that no data is returned when running in Azure, however locally it works fine.

This does not seem to be a CORS issue as all requests are from the same domain. I have tried modifying the web.config to remove WebDav. I have asked on github: https://github.com/aspnet/AspNetCore/issues/13630#issuecomment-527678673

They told me to ask here and think it's me.

Here is the site: http://daringclub.azurewebsites.net/fetchdata

If you load up the template, you literally have the exact same code.

I would expect that using the template and immediately publishing to azure without making any changes should just work out of the box.

Edit:

I've just upgraded to .net Core 3 Preview 9 and have been able to successfully publish the Blazor template (Client, Server and Shared version, I think it's called Blazor Client Hosted or something).

I now need to comment out code from my main site till stuff works, cause that's how I program ;)

Steve Buchok
  • 169
  • 1
  • 10
  • 1
    It's a preview of 3.0. If you publish that without using a self-contained publish, the App Service might not have that runtime installed yet so it won't work. It should work if you publish a self-contained app however it should work as the runtime will be packaged with your app. – juunas Sep 04 '19 at 05:06
  • "...not working..." - this information is not really helpful. It does not say what exactly did not work, i.e. did you get any error messages anywhere, did you try to debug the issue to make sure that it actually does the intended thing. – jazb Sep 04 '19 at 05:48
  • 1
    Check if you have either self-contained or use [this answer](https://stackoverflow.com/a/56545291/60761). – H H Sep 04 '19 at 05:51
  • Thanks Henk, your other post I had seen and tried prior. But I think there was an issue with preview 8 that was preventing it from working (I was getting errors). Preview 9 seems to work. – Steve Buchok Sep 05 '19 at 13:53
  • @JohnB, I gave a URL at the time that showed the issue. I figured people might try it out rather than me give a poor explanation. I also didn't say "...not working..." I said no data was coming back from a specific page. I assumed that with the page and a very brief description of the issue people would see what was happening and be able to give advice as to what to take a look at. And, I was right, some people did help. – Steve Buchok Sep 05 '19 at 18:40

1 Answers1

0

As Henk provided, check if you have self-contained app and make sure Azure could host .net core 3.0 then publish it.

In the Azure Portal, go to your WebApp after deployment (or create one beforehand).

Go to Extensions and click Add and select ASP.NET Core 3.0 (x86 for the free hosting).

Also go to Configuration, General settings and enable Web Sockets, they're Off by default.

Refer to this SO thread.

slugster
  • 49,403
  • 14
  • 95
  • 145
Joey Cai
  • 18,968
  • 1
  • 20
  • 30
  • This isn't Blazor server-side, web sockets aren't needed. I had already installed the Extension before publishing and this time, made sure the versions matched ;) – Steve Buchok Sep 05 '19 at 13:49