Exemplo n.º 1
0
        public async Task <bool> IsPendingCreation([ActivityTrigger] DataFactoryAccess dfAccess)
        {
            var result = await _dataFactory.IsPendingCreation(dfAccess);

            if (!result)
            {
                throw new ApplicationException();
            }
            return(true);
        }
Exemplo n.º 2
0
        public async Task <string> RunOrchestrator(
            [OrchestrationTrigger] IDurableOrchestrationContext context)
        {
            var accessToken = await _dataFactory.CreateAccessToken();

            var inputData = new DataFactoryAccess(accessToken, "fin-datafactory-westeurope");

            await context.CallActivityAsync <Factory>("CreateDataFactory", inputData);

            try
            {
                // check if the data factory has been provisioned every minute for up to 10 minutes
                await context.CallActivityWithRetryAsync <bool>("IsPendingCreation",
                                                                new RetryOptions(TimeSpan.FromMinutes(1), 10), inputData);
            }
            catch
            {
                return("Failed to provision data factory");
            }

            await CreateLinkedService(inputData);

            return(string.Empty);
        }
Exemplo n.º 3
0
 public Task <LinkedServiceResource> CreateLinkedService([ActivityTrigger] DataFactoryAccess dfAccess) =>
 _dataFactory.CreateLinkedService(dfAccess);
Exemplo n.º 4
0
 public Task <Factory> CreateDataFactory([ActivityTrigger] DataFactoryAccess dfAccess) =>
 _dataFactory.CreateDataFactory(dfAccess);