コード例 #1
0
        public async Task <bool> UpdateGitHubSetting(string clientId, string clientSecret, TableStorageAuth tableStorageAuth, string settingsTable,
                                                     string owner, string repo, string branch, string workflowName, string workflowId, string resourceGroupName, int itemOrder)
        {
            string         partitionKey = "GitHubSettings";
            string         rowKey       = CreateGitHubSettingsPartitionKey(owner, repo, workflowName);
            GitHubSettings settings     = new GitHubSettings
            {
                RowKey                  = rowKey,
                ClientId                = clientId,
                ClientSecret            = clientSecret,
                Owner                   = owner,
                Repo                    = repo,
                Branch                  = branch,
                WorkflowName            = workflowName,
                WorkflowId              = workflowId,
                ProductionResourceGroup = resourceGroupName,
                ItemOrder               = itemOrder
            };

            string json = JsonConvert.SerializeObject(settings);
            AzureStorageTableModel newItem = new AzureStorageTableModel(partitionKey, rowKey, json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageAuth, settingsTable);

            return(await tableDA.SaveItem(newItem));
        }
コード例 #2
0
        public async Task <bool> UpdateAzureDevOpsSetting(string patToken, TableStorageAuth tableStorageAuth, string settingsTable,
                                                          string organization, string project, string repository, string branch, string buildName, string buildId, string resourceGroupName, int itemOrder)
        {
            string partitionKey          = "AzureDevOpsSettings";
            string rowKey                = CreateAzureDevOpsSettingsPartitionKey(organization, project, repository, buildName);
            AzureDevOpsSettings settings = new AzureDevOpsSettings
            {
                RowKey                  = rowKey,
                PatToken                = patToken,
                Organization            = organization,
                Project                 = project,
                Repository              = repository,
                Branch                  = branch,
                BuildName               = buildName,
                BuildId                 = buildId,
                ProductionResourceGroup = resourceGroupName,
                ItemOrder               = itemOrder
            };

            string json = JsonConvert.SerializeObject(settings);
            AzureStorageTableModel newItem = new AzureStorageTableModel(partitionKey, rowKey, json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageAuth, settingsTable);

            return(await tableDA.SaveItem(newItem));
        }
コード例 #3
0
        public async Task <bool> UpdateDevOpsMonitoringEvent(TableStorageAuth tableStorageAuth, MonitoringEvent monitoringEvent)
        {
            string partitionKey            = monitoringEvent.PartitionKey;
            string rowKey                  = monitoringEvent.RowKey;
            string json                    = monitoringEvent.RequestBody;
            AzureStorageTableModel newItem = new AzureStorageTableModel(partitionKey, rowKey, json);
            TableStorageCommonDA   tableDA = new TableStorageCommonDA(tableStorageAuth, tableStorageAuth.TableMTTR);

            return(await tableDA.SaveItem(newItem));
        }