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
+29-51Lines changed: 29 additions & 51 deletions
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: 06/03/2025
8
+
ms.date: 06/11/2025
9
9
uid: blazor/call-web-api
10
10
---
11
11
# Call a web API from ASP.NET Core Blazor
@@ -124,7 +124,7 @@ To configure a production distributed cache provider, see <xref:performance/cach
124
124
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. -->
129
129
130
130
UseasharedDataProtectionkeyringinproductionsothatinstancesoftheappacrossserversinawebfarmcandecrypttokens when <xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.MsalDistributedTokenCacheAdapterOptions.Encrypt%2A?displayProperty=nameWithType> is set to `true`.
@@ -138,7 +138,7 @@ Use a shared Data Protection key ring in production so that instances of the app
Thefollowingexampleshowshowtouse [AzureBlobStorageandAzureKeyVault (`PersistKeysToAzureBlobStorage`/`ProtectKeysWithAzureKeyVault`)](xref:security/data-protection/configuration/overview#protect-keys-with-azure-key-vault-protectkeyswithazurekeyvault) forthesharedkeyring. Theserviceconfigurationsarebasecasescenariosfordemonstrationpurposes. Beforedeployingproductionapps, familiarizeyourselfwiththeAzureservicesandadoptbestpracticesusingtheAzureservices' dedicated documentation sets, which are linked at the end of this section.
*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.
170
-
171
-
*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`.
>:::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}":::
182
+
`{BLOBURI}`:FullURItothekeyfile. TheURIisgeneratedbyAzureStorage when you create the key file. Do not use a SAS.
`{KEYIDENTIFIER}`:AzureKeyVaultkeyidentifierusedforkeyencryption. Anaccesspolicyallowstheapplicationtoaccessthekeyvaultwith `Get`, `UnwrapKey`, and `WrapKey` permissions. ThekeyidentifierisobtainedfromthekeyintheEntraorAzureportalafterit'screated. Ifyouenableautorotationofthekeyvaultkey, makesurethatyouuseaversionlesskeyidentifierintheapp's key vault configuration, where no key GUID is placed at the end of the identifier (example: `https://contoso.vault.azure.net/keys/data-protection`).
*[Azure Storage Blob client library for JavaScript](/javascript/api/overview/azure/storage-blob-readme)
1258
1258
*[Blob service REST API](/rest/api/storageservices/blob-service-rest-api)
1259
-
* Authorize user uploads with a user-delegated shared-access signature (SAS) token generated by the app (server-side) for each client file upload. For example, Azure offers the following SAS features:
1259
+
* Authorize user uploads with a user-delegated sharedaccess signature (SAS) token generated by the app (server-side) for each client file upload. For example, Azure offers the following SAS features:
1260
1260
*[Azure Storage File Share client library for JavaScript: with SAS Token](/javascript/api/overview/azure/storage-file-share-readme#with-sas-token)
1261
1261
*[Azure Storage Blob client library for JavaScript: with SAS Token](/javascript/api/overview/azure/storage-blob-readme#with-sas-token)
1262
1262
* Provide automatic redundancy and file share backup.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/server/index.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,9 @@ For a deeper exploration of scaling server-side Blazor apps on the Azure Contain
151
151
152
152
:::moniker-end
153
153
154
+
> [!NOTE]
155
+
> The preceding example uses <xref:Azure.Identity.DefaultAzureCredential> to simplify authentication while developing apps that deploy to Azure by combining credentials used in Azure hosting environments with credentials used in local development. When moving to production, an alternative is a better choice, such as <xref:Azure.Identity.ManagedIdentityCredential>. For more information, see [Authenticate Azure-hosted .NET apps to Azure resources using a system-assigned managed identity](/dotnet/azure/sdk/authentication/system-assigned-managed-identity).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/account-confirmation-and-password-recovery.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,9 @@ public static class AzureHelper
119
119
}
120
120
```
121
121
122
+
> [!NOTE]
123
+
> The preceding example uses <xref:Azure.Identity.DefaultAzureCredential> to simplify authentication while developing apps that deploy to Azure by combining credentials used in Azure hosting environments with credentials used in local development. When moving to production, an alternative is a better choice, such as <xref:Azure.Identity.ManagedIdentityCredential>. For more information, see [Authenticate Azure-hosted .NET apps to Azure resources using a system-assigned managed identity](/dotnet/azure/sdk/authentication/system-assigned-managed-identity).
124
+
122
125
Where services are registered in the server project's `Program` file, obtain and bind the secret with [Options configuration](xref:fundamentals/configuration/options):
0 commit comments