Esempio n. 1
0
        private async Task Assign(HostAssignmentContext assignmentContext)
        {
            try
            {
                // first make all environment and file system changes required for
                // the host to be specialized
                assignmentContext.ApplyAppSettings();

                KuduEventGenerator.Log(null).LogMessage(EventLevel.Informational, assignmentContext.SiteName,
                                                        $"Mounting file share at {DateTime.UtcNow}", string.Empty);

                // Limit the amount of time time we allow for mounting to complete
                var mounted = await MountFileShareWithin(TimeSpan.FromSeconds(30));

                KuduEventGenerator.Log(null).LogMessage(EventLevel.Informational, assignmentContext.SiteName,
                                                        $"Mount file share result: {mounted} at {DateTime.UtcNow}", string.Empty);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                // all assignment settings/files have been applied so we can flip
                // the switch now on specialization
                // even if there are failures applying context above, we want to
                // leave placeholder mode
                _linuxConsumptionEnv.FlagAsSpecializedAndReady();
                _linuxConsumptionEnv.ResumeRequests();
            }
        }
Esempio n. 2
0
 private async Task Assign(HostAssignmentContext assignmentContext)
 {
     try
     {
         // first make all environment and file system changes required for
         // the host to be specialized
         assignmentContext.ApplyAppSettings();
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         // all assignment settings/files have been applied so we can flip
         // the switch now on specialization
         // even if there are failures applying context above, we want to
         // leave placeholder mode
         _linuxConsumptionEnv.FlagAsSpecializedAndReady();
         _linuxConsumptionEnv.ResumeRequests();
     }
 }