public static async Task <VstsInstanceEntity> GetAvailableVSTSInstance( [ActivityTrigger] VSTSIntegrationContext vstsIntegrationContext, ILogger log ) { var VstsInstanceService = new VstsInstanceService(Environment.GetEnvironmentVariable("SkillsBundleTablesConnectionsString")); return(await VstsInstanceService.GetAvailableInstance(vstsIntegrationContext.AzureLocation)); }
private async static Task InitVSTSInstances(CloudTable vstsInstanceCloudTable, CloudQueue pendingVstsCloudQueue) { var vstsEntity = new VstsInstanceEntity("SkillsBundle", "westeurope"); vstsEntity.AvailableFreeBasicUserSlot = 4; var vstsInstanceService = new VstsInstanceService(Environment.GetEnvironmentVariable("SkillsBundleTablesConnectionsString")); await vstsInstanceService.Add(vstsEntity); await pendingVstsCloudQueue.AddMessageAsync(new CloudQueueMessage(vstsEntity.InstanceName)); }
public static async Task ReQueueAvailableVstsInstance( [QueueTrigger("vstspendingavailableinstances", Connection = "SkillsBundleTablesConnectionsString")] string pendingInstance, IBinder binder, ILogger log) { var VstsInstanceService = new VstsInstanceService(Environment.GetEnvironmentVariable("SkillsBundleTablesConnectionsString")); var vstsInstanceEntity = await VstsInstanceService.Get(pendingInstance); var queueAttribute = new QueueAttribute($"vstsavailableinstances-{vstsInstanceEntity.Region}"); queueAttribute.Connection = "SkillsBundleTablesConnectionsString"; var queue = await binder.BindAsync <CloudQueue>(queueAttribute); await queue.AddMessageAsync(new CloudQueueMessage(pendingInstance)); }