Exemplo n.º 1
0
        public static async void ProcessAuditItem(Model.AuditItem auditItem)
        {
            var config = GetConfig();

            Console.WriteLine($"User {auditItem.UserId} {auditItem.Operation} {auditItem.ItemType} {auditItem.SourceFileName}  in {auditItem.SourceRelativeUrl} on {auditItem.SiteUrl}");
            var stc = retrieveSiteToCapture(auditItem.Site);
            IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
                                                                           .Create(config["ClientId"])
                                                                           .WithTenantId(config["TenantID"])
                                                                           .WithClientSecret(config["ClientSecret"])
                                                                           .Build();

            ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);
            GraphServiceClient       graphClient  = new GraphServiceClient(authProvider);

            var site = await graphClient.Sites["049287e5-abd9-472d-828b-a0a591ca2421"]
                       .Request()
                       .GetAsync();
        }
Exemplo n.º 2
0
 public static void Run([QueueTrigger("auditstoragequeue", Connection = "StorageAccountConnectionString")] string myQueueItem, ILogger log)
 {
     log.LogInformation($"ProcessAuditItem Started");
     Model.AuditItem auditItem = JsonSerializer.Deserialize <Model.AuditItem>(myQueueItem);
     Utilities.ProcessAuditItem(auditItem);
 }