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

The BlazorWasm sample can not see the bff endpoint after deployment to the Azure App Service. #1528

Open
oleinselmannhaagensen opened this issue Dec 30, 2024 · 3 comments
Labels

Comments

@oleinselmannhaagensen
Copy link

Which version of Duende BFF are you using?
2.2.0

Which version of .NET are you using?
8.0

Describe the bug

I downloaded the BFF sample from the GitHub Samples site.
The link is https://github.com/DuendeSoftware/Samples/tree/main/IdentityServer/v7/BFF/BlazorWasm

I have not changed anything in the code.
I select the BlazorWasm.Server project and publish it to my Azure App Service.
The settings in the App Service are standard configurations. See later in the description.
When I click on Log In, it gives me an error message.

Sorry, there's nothing at this address.

It works fine when I run locally on my computer.

I have tried to add UseForwardedHeaders. No difference.

Expected behavior

Should show me the login page when using https://demo.duendesoftware.com

Azure App Service configuration

Stack: .net
.net version .net 8
32 bit
Windows not container
The rest of the parameters are the default

Kindly regards,

Ole

@RolandGuijt
Copy link

I just tried the steps you outlined and it worked straight away. (https://blazorwasmserver20250104121538.azurewebsites.net/)

Are there any restrictions on the app plan or subscription you're using perhaps? Or maybe there's a browser issue. Can you try with another browser please?

@oleinselmannhaagensen
Copy link
Author

oleinselmannhaagensen commented Jan 6, 2025

Hi again

Sorry for the delay in my answer.

I can confirm that the BlazorWasm example is working.

But I need the solution as a PWA. So, I added PWA support.

It's still working, but the browser log shows error messages. The Duende login is shown at the top of the window and can be closed. See the screenshot.

There are these two errors in the browser log

  • Fetch event handler is recognized as no-op. No-op fetch handler may bring overhead during navigation. Consider removing the handler if possible
  • An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing

But the app I am working on is not working.

I have added something that does not work, so I will try adding the components individually.

I still want to use the BFF setup and the Hosted Blazor.

How can I have more control of the log in and log out process, so it's not just a

Log in or <a href="@context.User.FindFirst("bff:logout_url")?.Value">Log out

Image

@oleinselmannhaagensen
Copy link
Author

oleinselmannhaagensen commented Jan 7, 2025

I think I have found the reason why I get the error

"Sorry, there's nothing at this address"

when I press the log-in link browsing to bff/login.

It's related to running BlazorWasm upgraded to .net 9.

I have tried switching between .net 8 and .net 9. When upgrading to .net 9 and then back to .net 8, it only works again if I run the browser in private mode. I used both Edge and Chrome in private mode. Then, after logging in to .net 8 mode, I can successfully use the browser in normal mode again. It doesn't matter if I run in PWA mode or browser mode.

So, I have a theory about Azure Web App, Bff, and .net 9. As a note running in Blazor Server interactive mode works fine in .net9. I have only seen the problem in Blazor Webassembly mode.

Upgrading BlazorWasm to the newest Duende.BFF version 2.3 and the newest .net 8 packages are also working fine

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

2 participants