You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/call-web-api.md
+65-5Lines changed: 65 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to call a web API from Blazor apps.
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: wpickett
7
7
ms.custom: mvc
8
-
ms.date: 05/30/2025
8
+
ms.date: 06/03/2025
9
9
uid: blazor/call-web-api
10
10
---
11
11
# Call a web API from ASP.NET Core Blazor
@@ -124,6 +124,10 @@ To configure a production distributed cache provider, see <xref:performance/cach
124
124
125
125
Formoreinformation, see [Tokencacheserialization: Distributedcaches](/entra/msal/dotnet/how-to/token-cache-serialization?tabs=msal#distributed-caches). However, thecodeexamplesshowndon't apply to ASP.NET Core apps, which configure distributed caches via <xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A>, not <xref:Microsoft.Identity.Web.TokenCacheExtensions.AddDistributedTokenCache%2A>.
changes when updating this portion of content. -->
130
+
127
131
UseasharedDataProtectionkeyringinproductionsothatinstancesoftheappacrossserversinawebfarmcandecrypttokens when <xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.MsalDistributedTokenCacheAdapterOptions.Encrypt%2A?displayProperty=nameWithType> is set to `true`.
128
132
129
133
> [!NOTE]
@@ -135,22 +139,73 @@ Use a shared Data Protection key ring in production so that instances of the app
*Uploadthekeyfile (`keys.xml`) tothecontainerofthestorageaccount. Usethecontextmenu's **View/edit** command at the end of the key row in the portal to confirm that the blob contains the preceding content.
171
+
172
+
*Usethecontextmenu's **Generate SAS** command to obtain the blob'sURIwithasharedaccesssignature (SAS). WhenyoucreatetheSAS, usethefollowingpermissions: `Read`, `Add`, `Create`, `Write`, `Delete`. TheURIisusedlaterwherethe `{BLOBURIWITHSAS}` placeholderappears.
*Whenkeyencryptionisactive, keysinthekeyfileincludethecomment, ":::no-loc text="ThiskeyisencryptedwithAzureKeyVault.":::" After starting the app, select the **View/edit** command from the context menu at the end of the key row to confirm that a key is present with key vault security applied.
`{BLOBURIWITHSAS}`:ThefullURIwherethekeyfileshouldbestoredwiththeSAStokenasaquerystringparameter. TheURIisgeneratedbyAzureStorage 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`.
203
+
204
+
Example::::no-loctext="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}":::
0 commit comments