public async Task <HttpResponseMessage> ExtendResourceExpirationTime() { var resourceManager = await ResourcesManager.GetInstanceAsync(); var resourceGroup = await resourceManager.GetResourceGroup(HttpContext.Current.User.Identity.Name); try { resourceGroup = await resourceManager.ExtendResourceExpirationTime(resourceGroup); SimpleTrace.TraceInformation("{0}; {1}", AnalyticsEvents.ExtendTrial, resourceGroup.ResourceUniqueId); SimpleTrace.ExtendResourceGroup(resourceGroup); return(Request.CreateResponse(HttpStatusCode.OK, GetUIResource(resourceGroup))); } catch (ResourceCanOnlyBeExtendedOnce e) { SimpleTrace.Diagnostics.Error(e, "Resource Extended Once"); return(Request.CreateResponse(HttpStatusCode.BadRequest, e.Message)); } catch (Exception e) { SimpleTrace.Diagnostics.Fatal(e, "Error extending expiration time"); return(Request.CreateResponse(HttpStatusCode.InternalServerError, Resources.Server.Error_GeneralErrorMessage)); } }