Skip to content

Commit 20ca035

Browse files
authored
Patch article updates (#35567)
1 parent ab12963 commit 20ca035

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

aspnetcore/blazor/call-web-api.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@ Production web apps and web APIs should use a production distributed token cache
112112
113113
<xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A> adds a default implementation of <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> that stores cache items in memory, which is used by Microsoft Identity Web for token caching.
114114
115-
> [!NOTE]
116-
> <xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A> requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory).
117-
>
118-
> [!INCLUDE[](~/includes/package-reference.md)]
115+
<xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A> requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory).
116+
117+
[!INCLUDE[](~/includes/package-reference.md)]
119118
120119
To configure a production distributed cache provider, see <xref:performance/caching/distributed>.
121120
@@ -201,11 +200,15 @@ builder.Services.AddDataProtection()
201200
202201
`{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`.
203202
204-
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}":::
203+
Example:
204+
205+
> :::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}":::
205206
206207
`{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.
207208
208-
Example: :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}":::
209+
Example:
210+
211+
> :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}":::
209212
210213
Inject <xref:Microsoft.Identity.Abstractions.IDownstreamApi> and call <xref:Microsoft.Identity.Abstractions.IDownstreamApi.CallApiForUserAsync%2A> when calling on behalf of a user:
211214
@@ -366,14 +369,14 @@ The solution includes a demonstration of obtaining weather data securely via an
366369
367370
## Disposal of `HttpRequestMessage`, `HttpResponseMessage`, and `HttpClient`
368371
369-
An <xref:System.Net.Http.HttpRequestMessage> 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:
372+
An <xref:System.Net.Http.HttpRequestMessage> 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:
370373
371-
* It provides a performance improvement by avoiding finalizers.
372-
* It hardens the code for the future in case a request body is ever added to a <xref:System.Net.Http.HttpRequestMessage> that didn't initially have one.
373-
* It potentially avoids functional issues if a delegating handler expects <xref:System.IDisposable.Dispose%2A>/<xref:System.IAsyncDisposable.DisposeAsync%2A> to be called.
374-
* It's simpler to apply a general rule everywhere than trying to remember the specific cases when it matters.
374+
* To gain a performance improvement by avoiding finalizers.
375+
* It hardens the code for the future in case a request body is ever added to an <xref:System.Net.Http.HttpRequestMessage> that didn't initially have one.
376+
* To potentially avoid functional issues if a delegating handler expects a call to <xref:System.IDisposable.Dispose%2A>/<xref:System.IAsyncDisposable.DisposeAsync%2A>.
377+
* It's simpler to apply a general rule everywhere than trying to remember specific cases.
375378
376-
Always dispose of <xref:System.Net.Http.HttpResponseMessage> instances.
379+
***Always*** dispose of <xref:System.Net.Http.HttpResponseMessage> instances.
377380
378381
***Never*** dispose of <xref:System.Net.Http.HttpClient> instances created by calling <xref:System.Net.Http.IHttpClientFactory.CreateClient%2A> because they're managed by the framework.
379382

aspnetcore/blazor/security/blazor-web-app-with-entra.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,9 @@ builder.Services.Configure<MsalDistributedTokenCacheAdapterOptions>(
732732
});
733733
```
734734
735-
> [!NOTE]
736-
> <xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A> requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory).
737-
>
738-
> [!INCLUDE[](~/includes/package-reference.md)]
735+
<xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A> requires a package reference to the [`Microsoft.Extensions.Caching.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory).
736+
737+
[!INCLUDE[](~/includes/package-reference.md)]
739738

740739
To configure a production distributed cache provider, see <xref:performance/caching/distributed>.
741740

@@ -823,11 +822,15 @@ builder.Services.AddDataProtection()
823822

824823
`{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`.
825824

826-
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}":::
825+
Example:
826+
827+
> :::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}":::
827828
828829
`{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.
829830

830-
Example: :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}":::
831+
Example:
832+
833+
> :::no-loc text="https://contoso.vault.azure.net/keys/data-protection/{KEY VERSION}":::
831834
832835
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:
833836

0 commit comments

Comments
 (0)