-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Missing a step #6523
Comments
This probably happened because it was assumed that As you suggest @rjamesnw, that's not a good idea. I'll add a paragraph to cover it. Thanks for bringing this to our attention. |
@rjamesnw We discussed it, and we're going add a hair more info to call out how |
Fixes #6523 [Internal Review Topic](https://review.docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-1.0&branch=pr-en-us-6528) Tiny nits in the app secrets update: "or later" and a couple of comma splices. What I wrote for another version of this was more explicit. I'm concerned that the current version doesn't tell devs exactly why/how `AddUserSecrets` is added, and it doesn't say that if `CreateDefaultBuilder` isn't used that they'll still need to do it manually. Starting with ... > \- Add the user secrets configuration source to the `Startup` constructor: > Add the user secrets configuration source with a call to \[AddUserSecrets](/dotnet/api/microsoft.extensions.configuration.usersecretsconfigurationextensions.addusersecrets) in the `Startup` constructor: > > \[!code-csharp\[](app-secrets/samples/1.1/UserSecrets/Startup.cs?name=snippet_StartupConstructor&highlight=5-8)] > ::: moniker-end > ::: moniker range=">= aspnetcore-2.0" > When a project calls \[CreateDefaultBuilder](/dotnet/api/microsoft.aspnetcore.webhost.createdefaultbuilder) to initialize a new instance of the host with preconfigured defaults, \[AddUserSecrets](/dotnet/api/microsoft.extensions.configuration.usersecretsconfigurationextensions.addusersecrets) is called when the \[EnvironmentName](/dotnet/api/microsoft.aspnetcore.hosting.ihostingenvironment.environmentname) is \[Development](/dotnet/api/microsoft.aspnetcore.hosting.environmentname.development): > > \[!code-csharp\[](app-secrets/samples/2.1/UserSecrets/Program.cs?name=snippet_CreateWebHostBuilder&highlight=2)] > > When `CreateDefaultBuilder` isn't called during host construction, add the user secrets configuration source with a call to \[AddUserSecrets](/dotnet/api/microsoft.extensions.configuration.usersecretsconfigurationextensions.addusersecrets) in the `Startup` constructor: > > \[!code-csharp\[](app-secrets/samples/1.1/UserSecrets/Startup.cs?name=snippet_StartupConstructor&highlight=5-8)] > ::: moniker-end Snippet the call to `CreateDefaultBuilder` to show it (line 2 is highlighted) ... ```csharp #region snippet_CreateWebHostBuilder public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); #endregion ``` ... and the sample naming issue remains ("1.1" and "2.1" instead of "1.x" and "2.x"). If anything here looks good, I can mod this branch to make additional updates. Otherwise, nevermind. Just spit-ball'in here.
Also you need to confirm if the secrets tool is really bundled. I have the latest SDK installed and it is NOT bundled by default for new projects (as your help site claims). I had to add |
It was covered here 👉 https://docs.microsoft.com/aspnet/core/security/app-secrets?view=aspnetcore-2.0&tabs=windows#install-the-secret-manager-tool. The likely reason that 1.0.1 is shown and not a 2.0 approach is that we expect all devs to upgrade from 2.0 to 2.1, thus all devs will get global tool installs with 2.1. That's the plan AFAIK anyway. @scottaddie Do you have additional thoughts? |
You totally missed my point. I know it is there, I even alluded to it. I’m telling you I have 2.1 installed and the tool is NOT available anywhere until I “install” the Nugget package into my project. Is it stands, following the steps on the page for 2.1 like I did does not supply any tools at all. |
Yes, I see what you mean now. The "latest (released) SDK" is 2.0 ... threw me off for a sec. Idk if it will help, but they're working on the PR to cover global tools here 👉 dotnet/docs#5036 ... there might be some troubleshooting/gotcha info in their topic(s) on that PR. [EDIT] For example, feeds can be a problem to address with the pre-release bits. Idk on the 2.1 SDK not installing the Secret Manager tool specifically. Scott will be along at some point and may be able to help. |
@natemcmaster If using the .NET Core 2.1 SDK with an ASP.NET Core 2.0 app, I assume the |
Unfortunately, the "2.1 SDK" is a bit ambiguous1. You will need the Also, it's important to note that this is independent of the version of ASP.NET Core. You can use the 2.1.300 SDK for any version of ASP.NET, all the way back to 1.0. 1Starting with the 2.1.300 SDK, we plan to make sure the major.minor version of the SDK matches the latest .NET Core runtime it bundles. See dotnet/designs#29 |
@scottaddie That covers most of the problem, but I'm concerned about this ...
https://docs.microsoft.com/aspnet/core/security/app-secrets#install-the-secret-manager-tool ... leading right into an example with a 1.x era tool install. We probably don't care too much about 2.0 because our general plan is to cover the latest 2.x release (i.e., 2.1). For that line to call out "SDK 2.0" given what @natemcmaster just said is of concern. We should consider either spelling out all of the caveats of the 2.0-era (yuck! 😓) or make that line read ...
The sentence immediately prior to that ...
... is good. 👍 We can leave it at that given that we want devs to choose 2.1 over 2.0. Whatever we do, I think we should moniker-range the content coverage. |
That’s fine, but it would have saved me lots of time to see a note at least that “tool installation is necessary if you have 2.1.200 or earlier” since I DID have it, and many others in company environments may also have it and not able to update on the bleeding edge. ;) |
Yes, but 2.1 won't be bleeding edge on May 30. I defer to @scottaddie and @Rick-Anderson how much 2.0 coverage they want. I'm slammed for the next few weeks, and I only have time to make the updates I suggested above ☝️. If they decide to do more, I request another author take on the task. |
I think it's important that we specify the exact SDK version that includes the tool. I say this because the older SDKs are always available for download on the All Downloads page. I can take care of the updates on this one. |
Thanks @scottaddie ... I'm trying hard now to wrap things up. |
Fixes #6523 **Changes** - Display the **Install the Secret Manager tool** section for all versions of ASP.NET Core, since it's not safe to assume the .NET Core SDK version being used. - Include the specific SDK version number which includes the Secret Manager tool - Add note about tool warning [Internal Review Page](https://review.docs.microsoft.com/en-us/aspnet/core/security/app-secrets?branch=pr-en-us-6564&view=aspnetcore-2.0&tabs=windows#install-the-secret-manager-tool)
@rjamesnw Thank you for your valuable feedback. The doc changes are live now. |
Nothing was working until I found an example that added a required line to the startup constructor:
You might want to add that vital piece of info. :/
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: