HttpListenerException: доступ запрещен, Azure Работа WebJobs не удалась - PullRequest
0 голосов
/ 18 апреля 2020

У меня есть. net Framework (4.7.2) веб-API. Я хочу опубликовать sh API для AZURE, но произошло исключение. Вот журналы от azure Непрерывные сведения о WebJob *

[04/18/2020 05:27:12 > 74b74f: SYS INFO] Status changed to Starting
[04/18/2020 05:27:12 > 74b74f: SYS WARN] 'Always On' doesn't appear to be enabled for this Web App. To ensure your continuous job doesn't stop running when the SCM host is idle for too long, consider enabling 'Always On' in the configuration settings for your Web App. Note: 'Always On' is available only in Basic, Standard and Premium modes.
[04/18/2020 05:27:12 > 74b74f: SYS INFO] WebJob singleton setting is False
[04/18/2020 05:27:14 > 74b74f: SYS INFO] Run script 'WTSIntegration.WebApi.exe' with script host - 'WindowsScriptHost'
[04/18/2020 05:27:14 > 74b74f: SYS INFO] Status changed to Running
[04/18/2020 05:27:16 > 74b74f: INFO] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Access is denied
[04/18/2020 05:27:16 > 74b74f: INFO]    at System.Net.HttpListener.SetupV2Config()
[04/18/2020 05:27:16 > 74b74f: INFO]    at System.Net.HttpListener.Start()
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties)
[04/18/2020 05:27:16 > 74b74f: INFO]    --- End of inner exception stack trace ---
[04/18/2020 05:27:16 > 74b74f: INFO]    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
[04/18/2020 05:27:16 > 74b74f: INFO]    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
[04/18/2020 05:27:16 > 74b74f: INFO]    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(IAppBuilder builder)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer(StartContext context)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
[04/18/2020 05:27:16 > 74b74f: INFO]    at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
[04/18/2020 05:27:16 > 74b74f: INFO]    at WTSIntegration.WebApi.Program.Main(String[] args) in C:\Users\Olehrechukh\Desktop\WTS\src\WTSIntegration.WebApi\Program.cs:line 17

Program.cs

      var baseAddress = $"http://{WebConfigurationManager.AppSettings["address"]}" + 
$":{WebConfigurationManager.AppSettings["port"]}"; // http://localhost:5000
      // Start OWIN host 
         using (WebApp.Start<Startup>(baseAddress))
...