Пример #1
0
        public static async Task <IActionResult> manifestToModelJson(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log, ExecutionContext context)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");

            //get data from
            string tenantId       = req.Headers["TenantId"];
            string storageAccount = req.Headers["StorageAccount"];
            string rootFolder     = req.Headers["RootFolder"];
            string localFolder    = req.Headers["ManifestLocation"];
            string manifestName   = req.Headers["ManifestName"];

            AdlsContext adlsContext = new AdlsContext()
            {
                StorageAccount = storageAccount,
                FileSytemName  = rootFolder,
                MSIAuth        = true,
                TenantId       = tenantId
            };

            // Read Manifest metadata
            log.Log(LogLevel.Information, "Reading Manifest metadata");

            ManifestHandler manifestHandler = new ManifestHandler(adlsContext, localFolder);

            bool created = await manifestHandler.manifestToModelJson(adlsContext, manifestName, localFolder);

            return(new OkObjectResult("{\"Status\":" + created + "}"));
        }