private SearchIndexerSkillset CreateOrUpdateDemoSkillSet(SearchIndexerClient indexerClient, IList <SearchIndexerSkill> skills, string cognitiveServicesKey)
        {
            SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", skills)
            {
                Description = "Demo skillset",
                CognitiveServicesAccount = new CognitiveServicesAccountKey(cognitiveServicesKey)
            };

            // Create the skillset in your search service.
            // The skillset does not need to be deleted if it was already created
            // since we are using the CreateOrUpdate method
            try
            {
                indexerClient.CreateOrUpdateSkillset(skillset);
            }
            catch (RequestFailedException ex)
            {
                throw new Exception("Failed to create the skillset", ex);
            }

            return(skillset);
        }
        private static SearchIndexerSkillset CreateOrUpdateDemoSkillSet(SearchIndexerClient indexerClient, IList <SearchIndexerSkill> skills, string cognitiveServicesKey)
        {
            SearchIndexerSkillset skillset = new SearchIndexerSkillset("demoskillset", skills)
            {
                Description = "Demo skillset",
                CognitiveServicesAccount = new CognitiveServicesAccountKey(cognitiveServicesKey)
            };

            // Create the skillset in your search service.
            // The skillset does not need to be deleted if it was already created
            // since we are using the CreateOrUpdate method
            try
            {
                indexerClient.CreateOrUpdateSkillset(skillset);
            }
            catch (RequestFailedException ex)
            {
                Console.WriteLine("Failed to create the skillset\n Exception message: {0}\n", ex.Message);
                ExitProgram("Cannot continue without a skillset");
            }

            return(skillset);
        }