diff --git a/aspnetcore/blazor/call-web-api.md b/aspnetcore/blazor/call-web-api.md index 0ced7f8b9630..f7decd820c4f 100644 --- a/aspnetcore/blazor/call-web-api.md +++ b/aspnetcore/blazor/call-web-api.md @@ -112,10 +112,9 @@ Production web apps and web APIs should use a production distributed token cache adds a default implementation of that stores cache items in memory, which is used by Microsoft Identity Web for token caching. -> [!NOTE] -> requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory). -> -> [!INCLUDE[](~/includes/package-reference.md)] + requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory). + +[!INCLUDE[](~/includes/package-reference.md)] To configure a production distributed cache provider, see . @@ -201,11 +200,15 @@ builder.Services.AddDataProtection() `{BLOB URI WITH SAS}`: The full URI where the key file should be stored with the SAS token as a query string parameter. The URI is generated by Azure Storage when you request a SAS for the uploaded key file. The container name in the following example is `data-protection`, and the storage account name is `contoso`. The key file is named `keys.xml`. -Example: :::no-loc text="https://contoso.blob.core.windows.net/data-protection/keys.xml?sp={PERMISSIONS}&st={START DATETIME}&se={EXPIRATION DATETIME}&spr=https&sv={STORAGE VERSION DATE}&sr=c&sig={TOKEN}"::: +Example: + +> :::no-loc text="https://contoso.blob.core.windows.net/data-protection/keys.xml?sp={PERMISSIONS}&st={START DATETIME}&se={EXPIRATION DATETIME}&spr=https&sv={STORAGE VERSION DATE}&sr=c&sig={TOKEN}"::: `{KEY IDENTIFIER}`: Azure Key Vault key identifier used for key encryption. The key vault name is `contoso` in the following example, and an access policy allows the application to access the key vault with `Get`, `Unwrap Key`, and `Wrap Key` permissions. The example key name is `data-protection`. The version of the key (`{KEY VERSION}` placeholder) is obtained from the key in the Entra or Azure portal after it's created. -Example: :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}"::: +Example: + +> :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}"::: Inject and call when calling on behalf of a user: @@ -366,14 +369,14 @@ The solution includes a demonstration of obtaining weather data securely via an ## Disposal of `HttpRequestMessage`, `HttpResponseMessage`, and `HttpClient` -An without a body doesn't require explicit disposal with a [`using` declaration (C# 8 or later)](/dotnet/csharp/language-reference/proposals/csharp-8.0/using) or a `using` block (earlier than C# 8), but we recommend disposing with every use for the following reasons: +An without a body doesn't require explicit disposal with a [`using` declaration (C# 8 or later)](/dotnet/csharp/language-reference/proposals/csharp-8.0/using) or a [`using` block (all C# releases)](/dotnet/csharp/language-reference/keywords/using), but we recommend disposing with every use for the following reasons: -* It provides a performance improvement by avoiding finalizers. -* It hardens the code for the future in case a request body is ever added to a that didn't initially have one. -* It potentially avoids functional issues if a delegating handler expects / to be called. -* It's simpler to apply a general rule everywhere than trying to remember the specific cases when it matters. +* To gain a performance improvement by avoiding finalizers. +* It hardens the code for the future in case a request body is ever added to an that didn't initially have one. +* To potentially avoid functional issues if a delegating handler expects a call to /. +* It's simpler to apply a general rule everywhere than trying to remember specific cases. -Always dispose of instances. +***Always*** dispose of instances. ***Never*** dispose of instances created by calling because they're managed by the framework. diff --git a/aspnetcore/blazor/security/blazor-web-app-with-entra.md b/aspnetcore/blazor/security/blazor-web-app-with-entra.md index ed03211ef073..0d7fd1582883 100644 --- a/aspnetcore/blazor/security/blazor-web-app-with-entra.md +++ b/aspnetcore/blazor/security/blazor-web-app-with-entra.md @@ -732,10 +732,9 @@ builder.Services.Configure( }); ``` -> [!NOTE] -> requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory). -> -> [!INCLUDE[](~/includes/package-reference.md)] + requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory). + +[!INCLUDE[](~/includes/package-reference.md)] To configure a production distributed cache provider, see . @@ -823,11 +822,15 @@ builder.Services.AddDataProtection() `{BLOB URI WITH SAS}`: The full URI where the key file should be stored with the SAS token as a query string parameter. The URI is generated by Azure Storage when you request a SAS for the uploaded key file. The container name in the following example is `data-protection`, and the storage account name is `contoso`. The key file is named `keys.xml`. -Example: :::no-loc text="https://contoso.blob.core.windows.net/data-protection/keys.xml?sp={PERMISSIONS}&st={START DATETIME}&se={EXPIRATION DATETIME}&spr=https&sv={STORAGE VERSION DATE}&sr=c&sig={TOKEN}"::: +Example: + +> :::no-loc text="https://contoso.blob.core.windows.net/data-protection/keys.xml?sp={PERMISSIONS}&st={START DATETIME}&se={EXPIRATION DATETIME}&spr=https&sv={STORAGE VERSION DATE}&sr=c&sig={TOKEN}"::: `{KEY IDENTIFIER}`: Azure Key Vault key identifier used for key encryption. The key vault name is `contoso` in the following example, and an access policy allows the application to access the key vault with `Get`, `Unwrap Key`, and `Wrap Key` permissions. The example key name is `data-protection`. The version of the key (`{KEY VERSION}` placeholder) is obtained from the key in the Entra or Azure portal after it's created. -Example: :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}"::: +Example: + +> :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}"::: Alternatively, you can configure the app to supply the values from app settings files using the JSON Configuration Provider. Add the following to the app settings file: