This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NuGet: Azure.Identity (v1.4.0) と Microsoft.Azure.Cosmos (v3.20.0) を利用 | |
using Azure.Identity; | |
using Microsoft.Azure.Cosmos; | |
using System; | |
using System.Threading.Tasks; | |
namespace ConsoleApp | |
{ | |
public class RbacForDataOperations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Microsoft.Graph; | |
using Microsoft.Graph.Auth; | |
using Microsoft.Identity.Client; | |
namespace ConsoleAppForBlog | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Options; | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
namespace OptionsPatternSamples.Extensions | |
{ | |
public static class OptionBuilderExtensions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using OptionsPatternSamples.Options; | |
using System; | |
namespace OptionsPatternSamples | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using OptionsPatternSamples.Options; | |
using System; | |
namespace OptionsPatternSamples | |
{ | |
public class Startup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AzureAdOptions:TenantId": "<input your tenant id>", | |
"AzureAdOptions:ClientId": "<input your client id>", | |
"AzureAdOptions:ClientSecret": "<input your client secret>" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Logging": { | |
"LogLevel": { | |
"Default": "Information", | |
"Microsoft": "Warning", | |
"Microsoft.Hosting.Lifetime": "Information" | |
} | |
}, | |
"AllowedHosts": "*", | |
"AzureAdOptions": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel.DataAnnotations; | |
namespace OptionsPatternSamples.Options | |
{ | |
public class AzureAdOptions | |
{ | |
[Required] | |
public string TenantId { get; set; } | |
[Required] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace SerializerCustomizeSamples | |
{ | |
public class CognitiveSearchOptions | |
{ | |
public Uri SearchEndpointUri => new Uri(SearchEndpoint); | |
public string SearchEndpoint { get; set; } | |
public string AdminApiKey { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Azure; | |
using Azure.Core.Serialization; | |
using Azure.Search.Documents; | |
using Azure.Search.Documents.Indexes; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
using System.Text.Json; | |
namespace SerializerCustomizeSamples | |
{ |