public static async Task <IActionResult> RunByApplicationResourceId([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, TraceWriter log)
        {
            _log = log;
            string id = req.Query["id"];

            if (string.IsNullOrWhiteSpace(id))
            {
                const string message = "No id parameter found in querystring";
                _log.Verbose(message);
                return(new BadRequestObjectResult(message));
            }
            else
            {
                _log.Info($"Found id '{id}' in querystring to rotate");
            }

            var azure       = GetAzureConnection();
            var application = await GetApplication(azure, id);

            if (application == null)
            {
                return(new NotFoundResult());
            }

            var          worker  = new RotatorWorker(_log);
            const string keyName = "RotatedKey";
            await worker.Rotate(application, keyName);

            return(new OkResult());
        }
        public static async Task <IActionResult> RunAllApplicationIds([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, TraceWriter log)
        {
            _log = log;
            var worker = new RotatorWorker(_log);
            await worker.RotateAll();

            return(new OkResult());
        }