Skip to content

Commit 48b9d82

Browse files
committed
added language
1 parent c61094f commit 48b9d82

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/azure/sdk/aspnetcore-guidance.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ Complete the following steps to register the services you need:
3737
3838
3. In the `Program.cs` file of your app, invoke the `AddAzureClients` extension method from the `Microsoft.Extensions.Azure` library to register a client for each service. Some services use additional subclients, which you can also register for dependency injection.
3939
40-
:::code source="snippets/aspnetcore-guidance/BlazorSample/Program.cs" range="11-30":::
40+
:::code language="csharp" source="snippets/aspnetcore-guidance/BlazorSample/Program.cs" range="11-30":::
4141
4242
4. Inject the registered services into your ASP.NET Core app components, services, or API endpoint methods:
4343
4444
<!-- markdownlint-disable MD023 -->
4545
## [Minimal API](#tab/api)
4646
47-
:::code source="snippets/aspnetcore-guidance/MinApiSample/Program.cs" range="44-59" highlight="44,47,48":::
47+
:::code language="csharp" source="snippets/aspnetcore-guidance/MinApiSample/Program.cs" range="44-59" highlight="44,47,48":::
4848
4949
<!-- markdownlint-disable MD023 -->
5050
## [Blazor](#tab/blazor)
5151
52-
:::code source="snippets/aspnetcore-guidance/BlazorSample/Components/Pages/Home.razor" range="1-28" highlight="5,21":::
52+
:::code language="cshtml" source="snippets/aspnetcore-guidance/BlazorSample/Components/Pages/Home.razor" range="1-28" highlight="5,21":::
5353
5454
---
5555
@@ -64,7 +64,7 @@ Use the [Azure Identity client library](/dotnet/api/overview/azure/identity-read
6464
6565
Consider the following use of `DefaultAzureCredential`:
6666
67-
:::code source="snippets/aspnetcore-guidance/BlazorSample/Program.cs" range="11-30" highlight="29":::
67+
:::code language="csharp" source="snippets/aspnetcore-guidance/BlazorSample/Program.cs" range="11-30" highlight="29":::
6868
6969
In the preceding code, the `clientBuilder.UseCredential()` method accepts an instance of `DefaultAzureCredential` to reuse across your registered services. `DefaultAzureCredential` discovers available credentials in the current environment and use them to connect to Azure services. The complete order and locations that `DefaultAzureCredential` looks for credentials lives in the [`Azure Identity library overview`](/dotnet/api/overview/azure/Identity-readme#defaultazurecredential).
7070
@@ -95,7 +95,7 @@ In the following sections, complete the steps using the `appsettings.Development
9595
9696
1. Update the `appsettings.<environment>.json` file in your app with the highlighted service configurations:
9797
98-
:::code source="snippets/aspnetcore-guidance/MinApiSample/appsettings.Development.json" highlight="19-27":::
98+
:::code language="json" source="snippets/aspnetcore-guidance/MinApiSample/appsettings.Development.json" highlight="19-27":::
9999
100100
In the preceding JSON sample:
101101
@@ -104,19 +104,19 @@ In the following sections, complete the steps using the `appsettings.Development
104104
105105
1. Update the the `Program.cs` file to retrieve the JSON file configurations using `IConfiguration` and pass them into your service registrations:
106106
107-
:::code source="snippets/aspnetcore-guidance/MinApiSample/Program.cs" range="13-31" highlight="29-30":::
107+
:::code language="csharp" source="snippets/aspnetcore-guidance/MinApiSample/Program.cs" range="13-31" highlight="29-30":::
108108
109109
### Configure Azure defaults and retries
110110
111111
At some point, you may want to change default Azure client configurations globally or for a specific service client. For example, you may want different retry settings or to use a different service API version. You can set the retry settings globally or on a per-service basis.
112112
113113
1. Update your configuration file to set default Azure settings, such as a new default retry policy:
114114
115-
:::code source="snippets/aspnetcore-guidance/MinApiSample/appsettings.Development.json" highlight="9-18":::
115+
:::code language="json" source="snippets/aspnetcore-guidance/MinApiSample/appsettings.Development.json" highlight="9-18":::
116116
117117
2. In the `Program.cs` file, the `ConfigureDefaults` extension method `AddAzureClients` retrieves the default settings and applies them to your services:
118118
119-
:::code source="snippets/aspnetcore-guidance/MinApiSample/Program.cs" range="13-31" highlight="29,30":::
119+
:::code language="csharp" source="snippets/aspnetcore-guidance/MinApiSample/Program.cs" range="13-31" highlight="29,30":::
120120
121121
## Configure logging
122122
@@ -135,4 +135,4 @@ The following table depicts how the Azure SDK for .NET `EventLevel` maps to the
135135
136136
You can change default log levels and other settings using the same JSON configurations outlined in the [configure authentication](#authenticate-using-microsoft-entra-id) section. For example, toggle a the `ServiceBusClient` log level to `Debug` by setting the `Logging:LogLevel:Azure.Messaging.ServiceBus` key as follows:
137137
138-
:::code source="snippets/aspnetcore-guidance/MinApiSample/appsettings.Development.json" highlight="2-8":::
138+
:::code language="json" source="snippets/aspnetcore-guidance/MinApiSample/appsettings.Development.json" highlight="2-8":::

0 commit comments

Comments
 (0)