-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Issues within Visual Studio when selecting both Azure AD and Docker Linux support #24151
Comments
Hello @SeanKilleen , we are also trying to find the right place. Please share the relevant template name (if you know it) or steps to reproduce. Based on this we can then find the right repo. |
Thanks @donJoseLuis! My steps to recreate were:
Let me know if I can provide more detail. I think one template (Docker or AD) needs to be modified to detect the enablement of the other one and should add the additional code to forward the headers. One consideration: This may need to be an optional thing. We may want to add a method within Startup that accomplishes this, along with a comment and/or docs reference. This makes me think it's likely the template for "Work or School Accounts" auth that should be updated to see if there's a dockerfile in the solution. |
Hi @donJoseLuis -- wanted to follow up to make sure you'd seen my reply and that this is no longer labeled as |
Greetings @SeanKilleen . Thanks for the ping. |
@mkArtakMSFT looks like this is ASP.NET template issue. Could you, please, point me to the right repo, where is the source of template located? |
@SeanKilleen this repo contains only template engine source code and couple of templates. The ASP.NET templates are located in a different repo. I asked the guy, who can point us to the right place. |
@grinrag this is the right repo for the aspnetcore templates. |
What version are you using? This should have been addressed back in 3.0. See https://devblogs.microsoft.com/aspnet/forwarded-headers-middleware-updates-in-net-core-3-0-preview-6/ |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. See our Issue Management Policies for more information. |
Sorry, I'd missed this in a bunch of notifications. @Tratcher I was using Visual studio 2019 with latest updates at the time and .NET Core 3.1 installed. When using the templates, I had to manually add the change for it to work. Are you saying that you're currently unable to reproduce it with the steps I provided? |
Thanks for contacting us. |
After some investigation, I confirm that the headers forwarder middleware is registered, but it's only enabled if the However when running the template in VS neither of these are set from what I experienced. {
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "qualified.domain.name",
"TenantId": "22222222-2222-2222-2222-222222222222",
"ClientId": "11111111-1111-1111-11111111111111111",
"CallbackPath": "/signin-oidc"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
} |
@Tratcher Might be good to put the setting into the template, but set to |
Where? It's set to true in the actual docker file when published. I wouldn't expect it in appsettings.json since that would conflict with the docker file, but maybe launchsettings.json? |
Can you point me to the file? I tried with 3.1 templates. |
How is the file you shared related to the one that is generated with the template? In the templates the based image is the standard aspnet runtime one.
|
And that is probably the disconnect here. We fixed this issue primarily for azure app service linux hosting. I don't know if the same fix was applied to our base image, nor how those are maintained. |
I see, these images are used when we upload/publish a .NET app as is, not when a Docker option is selected in VS. |
@vijayrkn Should I transfer this issue somewhere, or is there a bug in VS I can point to instead? |
There is an internal tracking bug on our side to set this app setting while publishing to App Service Container. This change is already implemented and should be available in the next update of Visual Studio. I think we can close this issue here. |
@vijayrkn that's great to hear! I know this was a tricky one. If possible, I'd love to keep it open until the next release is available so that I can pull it and verify. Any concerns there? |
No concerns with me. We can keep it open until the validation is complete. |
I'm not sure if this is the correct location as this issue deals with Visual Studio and this repository looks to be largely geared toward
dotnet new
. If I'm not in the right spot, feel free to close or forward me elsewhere.Recently, I created a project within Visual Studio. I selected .NET Core MVC. I enabled the options for Azure AD Auth (single organization) and Docker container support with Linux.
Upon publishing my container to an Azure Web app for Containers, I noticed that the redirect URI was specified as always using
http
.I opened an issue here: #22572
It turns out I needed to do some additional work to enable header forwarding in order for Azure AD auth to work within the container.
I'm hoping that we could get this added to the templating engine so that applications would work out of the box.
I'd be happy to send along a PR if someone points me in the right direction.
Thanks for all you do!
The text was updated successfully, but these errors were encountered: