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/host-and-deploy/webassembly/azure-static-web-apps.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,8 @@ To deploy from Visual Studio, create a publish profile for Azure Static Web Apps
30
30
31
31
After the publish profile is created, deploy the app to the Azure Static Web Apps instance using the publish profile by selecting the **Publish** button.
32
32
33
-
## Deploy from Visual Studio Code
33
+
## GitHub deployment scenarios
34
34
35
-
To deploy from Visual Studio Code, see [Quickstart: Build your first static site with Azure Static Web Apps](/azure/static-web-apps/getting-started?tabs=blazor).
36
-
37
-
## Deploy from GitHub
38
-
39
-
To deploy from a GitHub repository, see [Tutorial: Building a static web app with Blazor in Azure Static Web Apps](/azure/static-web-apps/deploy-blazor).
35
+
* Visual Studio Code: [Quickstart: Build your first static site with Azure Static Web Apps](/azure/static-web-apps/getting-started?tabs=blazor)
36
+
* .NET CLI: [Deploy Blazor websites to the cloud with Azure Static Web Apps (Video)](/shows/deploy-websites-to-the-cloud-with-azure-static-web-apps/deploy-blazor-websites-to-the-cloud-with-azure-static-web-apps)
37
+
* Deploy from GitHub: [Tutorial: Building a static web app with Blazor in Azure Static Web Apps](/azure/static-web-apps/deploy-blazor)
This article describes how to secure a Blazor Web App with [OpenID Connect (OIDC)](https://openid.net/developers/how-connect-works/) using a sample app in the [`dotnet/blazor-samples` GitHub repository (.NET 8 or later)](https://github.com/dotnet/blazor-samples) ([how to download](xref:blazor/fundamentals/index#sample-apps)).
17
17
18
-
:::moniker-range=">= aspnetcore-9.0"
18
+
:::zone pivot="non-bff-pattern"
19
+
20
+
:::moniker range=">= aspnetcore-9.0"
19
21
20
22
For Microsoft Entra ID or Azure AD B2C, you can use <xref:Microsoft.Identity.Web.AppBuilderExtension.AddMicrosoftIdentityWebApp%2A> from [Microsoft Identity Web](/entra/msal/dotnet/microsoft-identity-web/) ([`Microsoft.Identity.Web` NuGet package](https://www.nuget.org/packages/Microsoft.Identity.Web), [API documentation](<xref:Microsoft.Identity.Web?displayProperty=fullName>)), which adds both the OIDC and Cookie authentication handlers with the appropriate defaults. The sample app and the guidance in this article don't use Microsoft Identity Web. The guidance demonstrates how to configure the OIDC handler *manually* for any OIDC provider. For more information on implementing Microsoft Identity Web, see <xref:blazor/security/blazor-web-app-entra>.
21
23
22
24
:::moniker-end
23
25
24
-
:::zone pivot="non-bff-pattern"
25
-
26
26
This version of the article covers implementing OIDC without adopting the [Backend for Frontend (BFF) pattern](/azure/architecture/patterns/backends-for-frontends) with an app that adopts global Interactive Auto rendering (server and `.Client` projects). The BFF pattern is useful for making authenticated requests to external services. Change the article version selector to **BFF pattern** if the app's specification calls for adopting the BFF pattern.
27
27
28
28
The following specification is adopted:
@@ -377,6 +377,12 @@ The sample app only provides a user name and email for display purposes.
377
377
378
378
:::zone pivot="non-bff-pattern-server"
379
379
380
+
:::moniker range=">= aspnetcore-9.0"
381
+
382
+
For Microsoft Entra ID or Azure AD B2C, you can use <xref:Microsoft.Identity.Web.AppBuilderExtension.AddMicrosoftIdentityWebApp%2A> from [Microsoft Identity Web](/entra/msal/dotnet/microsoft-identity-web/) ([`Microsoft.Identity.Web` NuGet package](https://www.nuget.org/packages/Microsoft.Identity.Web), [API documentation](<xref:Microsoft.Identity.Web?displayProperty=fullName>)), which adds both the OIDC and Cookie authentication handlers with the appropriate defaults. The sample app and the guidance in this article don't use Microsoft Identity Web. The guidance demonstrates how to configure the OIDC handler *manually* for any OIDC provider. For more information on implementing Microsoft Identity Web, see <xref:blazor/security/blazor-web-app-entra>.
383
+
384
+
:::moniker-end
385
+
380
386
This version of the article covers implementing OIDC without adopting the [Backend for Frontend (BFF) pattern](/azure/architecture/patterns/backends-for-frontends) with an app that adopts global Interactive Server rendering (single project). The BFF pattern is useful for making authenticated requests to external services. Change the article version selector to **BFF pattern** if the app's specification calls for adopting the BFF pattern with global Interactive Auto rendering.
For Microsoft Entra ID or Azure AD B2C, you can use <xref:Microsoft.Identity.Web.AppBuilderExtension.AddMicrosoftIdentityWebApp%2A> from [Microsoft Identity Web](/entra/msal/dotnet/microsoft-identity-web/) ([`Microsoft.Identity.Web` NuGet package](https://www.nuget.org/packages/Microsoft.Identity.Web), [API documentation](<xref:Microsoft.Identity.Web?displayProperty=fullName>)), which adds both the OIDC and Cookie authentication handlers with the appropriate defaults. The sample app and the guidance in this article don't use Microsoft Identity Web. The guidance demonstrates how to configure the OIDC handler *manually* for any OIDC provider. For more information on implementing Microsoft Identity Web, see <xref:blazor/security/blazor-web-app-entra>.
732
+
733
+
:::moniker-end
734
+
723
735
This version of the article covers implementing OIDC with the [Backend for Frontend (BFF) pattern](/azure/architecture/patterns/backends-for-frontends). If the app's specification doesn't call for adopting the BFF pattern, change the article version selector to **Non-BFF pattern (Interactive Auto)** (Interactive Auto rendering) or **Non-BFF pattern (Interactive Server)** (Interactive Server rendering).
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/openapi/customize-openapi.md
+26-10Lines changed: 26 additions & 10 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 customize OpenAPI documents in an ASP.NET Core app
5
5
ms.author: safia
6
6
monikerRange: '>= aspnetcore-9.0'
7
7
ms.custom: mvc
8
-
ms.date: 10/26/2024
8
+
ms.date: 05/15/2025
9
9
uid: fundamentals/openapi/customize-openapi
10
10
---
11
11
# Customize OpenAPI documents
@@ -44,18 +44,18 @@ Transformers can be registered onto the document by calling the <xref:Microsoft.
44
44
45
45
### Execution order for transformers
46
46
47
-
Transformers are executed as follows:
47
+
Transformers execute in the following order:
48
48
49
-
* Schema transformers are executed when a schema is registered to the document. Schema transformers are executed in the order in which they were added.
50
-
All schemas are added to the document before any operation processing occurs, so all schema transformers are executed before any operation transformers.
51
-
* Operation transformers are executed when an operation is added to the document. Operation transformers are executed in the order in which they were added.
52
-
All operations are added to the document before any document transformers are executed.
53
-
* Document transformers are executed when the document is generated. This is the final pass over the document, and all operations and schemas have been add by this point.
54
-
* When an app is configured to generate multiple OpenAPI documents, transformers are executed for each document independently.
49
+
* Schema transformers execute when a schema is registered to the document. They execute in the order they're added.
50
+
All schemas are added to the document before any operation processing occurs, so schema transformers execute before operation transformers.
51
+
* Operation transformers execute when an operation is added to the document. They execute in the order they're added.
52
+
All operations are added to the document before any document transformers execute.
53
+
* Document transformers execute when the document is generated. This is the final pass over the document, and all operations and schemas are added by this point.
54
+
* When an app is configured to generate multiple OpenAPI documents, transformers execute for each document independently.
55
55
56
56
For example, in the following snippet:
57
57
*`SchemaTransformer2` is executed and has access to the modifications made by `SchemaTransformer1`.
58
-
* Both `OperationTransformer1` and `OperationTransformer2` have access to the modifications made by both schema transformers for the types involved in the operation they are called to process.
58
+
* Both `OperationTransformer1` and `OperationTransformer2` have access to the modifications made by both schema transformers for the types involved in the operation they're called to process.
59
59
*`OperationTransformer2` is executed after `OperationTransformer1`, so it has access to the modifications made by `OperationTransformer1`.
60
60
* Both `DocumentTransformer1` and `DocumentTransformer2` are executed after all operations and schemas have been added to the document, so they have access to all modifications made by the operation and schema transformers.
61
61
*`DocumentTransformer2` is executed after `DocumentTransformer1`, so it has access to the modifications made by `DocumentTransformer1`.
@@ -119,6 +119,22 @@ For example, the following schema transformer sets the `format` of decimal types
Developers can generate a schema for a C# type using the same logic as ASP.NET Core OpenAPI document generation and add it to the OpenAPI document. The schema can then be referenced from elsewhere in the OpenAPI document. This capability is available starting with .NET 10.
126
+
127
+
The context passed to document, operation, and schema transformers includes a new `GetOrCreateSchemaAsync` method that can be used to generate a schema for a type.
128
+
This method also has an optional `ApiParameterDescription` parameter to specify additional metadata for the generated schema.
129
+
130
+
To support adding the schema to the OpenAPI document, a `Document` property has been added to the Operation and Schema transformer contexts. This allows any transformer to add a schema to the OpenAPI document using the document's `AddComponent` method.
131
+
132
+
### Example
133
+
134
+
To use this feature in a document, operation, or schema transformer, create the schema using the `GetOrCreateSchemaAsync` method provided in the context and add it to the OpenAPI document using the document's `AddComponent` method.
0 commit comments