I have a SharePoint Online provider hosted app running in Azure. I am provisioning a site collection using the code below. When it gets to ExecuteQuery() I get the error "Cannot find the endpoint specified by the configuration file". The error does not happen all the time. It's intermitent which makes troubleshooting even harder. I would appreciate any input you may have. Thanks.
var tenant = new Tenant(adminCtx);
var properties = new SiteCreationProperties()
{
Url = newSiteUrl,
Owner = adminUser
Title = newSiteTitle,
StorageMaximumLevel = Convert.ToInt64(storageMaximumLevel),
UserCodeMaximumLevel = Convert.ToInt64(useCodeMaximumLevel)
};
//start the SPO operation to create the site
SpoOperation op = tenant.CreateSite(properties);
adminCtx.Load(tenant);
adminCtx.Load(op, i => i.IsComplete);
adminCtx.ExecuteQuery();