public static async Task <string> Run([ActivityTrigger] string title, ILogger log, ExecutionContext context)
        {
            log.LogInformation($"getting group id for {title}");
            var client = GraphServiceClientFactory.GetInstance(context?.FunctionAppDirectory).Client.Value;

            var existingGroups = await client.Groups.Request().Filter($"displayName eq '{title}'").GetAsync();

            return(existingGroups.FirstOrDefault()?.Id);
        }
        public static async Task Run([ActivityTrigger] CreationResult input, ILogger log, ExecutionContext context)
        {
            var client = GraphServiceClientFactory.GetInstance(context?.FunctionAppDirectory).Client.Value;

            if (!await DoesTeamExist(input, client))
            {
                await EnableTeams(input, client);
            }
        }
        public static async Task Run([ActivityTrigger] CreationResult input, ILogger log, ExecutionContext context)
        {
            log.LogInformation("creating library tabs for client");
            var client     = GraphServiceClientFactory.GetInstance(context?.FunctionAppDirectory).Client.Value;
            var tabService = new TeamsTabService(client, AppDefId);

            await AddConfiguredLibTabsToChannel(input.GroupId, input.ProjectChannelId, input.ProjectSiteUrl, client, tabService, input.ProjectChannelLibTabsLibNames, webExtraction);

            log.LogInformation("created library tabs for client");
        }
Exemple #4
0
        public static async Task <Tuple <string, bool> > Run([ActivityTrigger] CreationResult input, ILogger log, ExecutionContext context)
        {
            var client         = GraphServiceClientFactory.GetInstance(context?.FunctionAppDirectory).Client.Value;
            var channels       = await client.Teams[input.GroupId].Channels.Request().GetAsync();
            var projectChannel = channels.FirstOrDefault(x => x.DisplayName.Equals(input.FullProjectTitle, StringComparison.InvariantCultureIgnoreCase));

            if (projectChannel == null)
            {
                return(new Tuple <string, bool>(await CreateChannel(input, client), true));
            }
            else
            {
                return(new Tuple <string, bool>(projectChannel.Id, false));
            }
        }