I've not tried doing *, however the following code permits you to specify which websites to add your Azure Search index.
using CMS;
using CMS.DataEngine;
using CMS.Search.Azure;
using CMSApp.SiteModules;
using System.Collections.Generic;
[assembly: RegisterModule(typeof(CustomAzureSearchModule))]
namespace CMSApp.SiteModules
{
public class CustomAzureSearchModule : Module
{
public CustomAzureSearchModule() : base("CustomAzureSearch")
{
}
protected override void OnInit()
{
base.OnInit();
SearchServiceManager.CreatingOrUpdatingIndex.Execute += AddCorsToIndex;
}
private void AddCorsToIndex(object sender, CreateOrUpdateIndexEventArgs e)
{
Microsoft.Azure.Search.Models.Index index = e.Index;
index.CorsOptions = new Microsoft.Azure.Search.Models.CorsOptions();
index.CorsOptions.AllowedOrigins = new List<string>()
{
"https://www.yourwebsite.com"
};
}
}
}
This was done on Kentico 12, and needs to be added to the Admin side.