Exemplo n.º 1
0
        public async Task UpdateStorageAccountReplayLog(string storageAccountConnectionString, string tableName, string subscriptionId, string resourceGroupName, string logicAppName, string oldRunId, string newRunId)
        {
            AzureStorageService azureStorageService = new AzureStorageService(storageAccountConnectionString);
            var _createTable = await azureStorageService.CreateCloudTable(tableName);

            LogicAppRunLog entity = new LogicAppRunLog();

            entity.PartitionKey = $"{subscriptionId}@{resourceGroupName}@{logicAppName}";
            entity.RowKey       = $"{oldRunId}";

            entity.IsReplayed = true;
            entity.NewRunId   = newRunId;

            await azureStorageService.InsertOrMergeEntityToTable(tableName, entity, enableMerge : true);
        }
Exemplo n.º 2
0
        public async Task LogToStorageAccount(IEnumerable <LogicAppWorkflowRun> logicAppWorkflowRuns, string storageAccountConnectionString, string tableName)
        {
            //string storageAccountConnectionString = "DefaultEndpointsProtocol=https;AccountName=azaust1lam585;AccountKey=1xTEw9Zf4aUtjfEaJs0DUNm5UWJ8t9mELjBOt+COd2dzfdngOr2uiahMJpG/8z7GegmzZ5RoA2mAbqS9XM9fvg==;EndpointSuffix=core.windows.net";
            //string tableName = "LogicAppRunHistory";

            AzureStorageService azureStorageService = new AzureStorageService(storageAccountConnectionString);
            var createTable = await azureStorageService.CreateCloudTable(tableName);

            foreach (var item in logicAppWorkflowRuns)
            {
                LogicAppRunLog entity = new LogicAppRunLog();
                entity.PartitionKey = $"{item.SubscriptionId}@{item.ResourceGroupName}@{item.LogicAppName}";
                entity.RowKey       = $"{item.Name}";

                var existedRecord = await azureStorageService.RetrieveEntityFromTable <LogicAppRunLog>(tableName, partitionKey : entity.PartitionKey, rowKey : entity.RowKey);

                if (existedRecord == null)
                {
                    await azureStorageService.InsertOrMergeEntityToTable(tableName, entity, enableMerge : false);
                }
            }
        }