0

I deploy an Azure Function with a service bus topic trigger from visual Studio. When I try to run the function I become an error.

Service Unavailable - https://*.scm.azurewebsites.net/api/functions/Function1 Session Id: 2f3a817b55eb4b188e2c3110d50169fd Timestamp: 2019-02-21T00:31:26.000Z

And when I click on the function host URL, I get this message:

Function host is not running.

I do the same in browser (create the function with the same trigger) everything will run fine. Without any problems.

What can I do to use visual studio to deploy azure functions?

Reagards

Update: I becone this error

2019-02-21T18:34:39

System.IO.IOException: The process cannot access the file 'D:\home\site\diagnostics\settings.json' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost) at System.IO.File.ReadAllText(String path) at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.ReadConfigFile()

12
  • Have you added the service bus connection string in Application settings? With name identical to the value of Connection parameter in code.
    – Jerry Liu
    Feb 21, 2019 at 2:49
  • The was a set from Visual Studio
    – Stefan
    Feb 21, 2019 at 6:22
  • Sorry I didn't get it clearly. Does it mean you have inserted the setting when publishing, like this? Note that settings in local.settings.json are not published to Azure site.
    – Jerry Liu
    Feb 21, 2019 at 6:28
  • I did the way from the link.
    – Stefan
    Feb 21, 2019 at 8:17
  • Have you checked the host logs? Go to https://<functionappname>.scm.azurewebsites.net/DebugConsole and navigate to D:\home\LogFiles\Application\Functions\Host.
    – Jerry Liu
    Feb 21, 2019 at 8:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.