0

I downloaded the code of an Azure Function created in the portal. Now I'm tryng to load a class in the main file (run.csx) using in the first line:

#load "..\shared\data.csx"

but i get the error:

 "run.csx(1,7): error CS1504: Source file '..\shared\data.csx' could not be opened -- Could not find file."

I added in the host.json:

"watchDirectories": [ "Shared" ]

I tried with uppercase, lowcase, put the class in the same folder of the run.csx but it doesn't work. I miss something?

Elelio
  • 287
  • 5
  • 18

1 Answers1

1

Double check that your "Shared" folder is under D:\home\site\wwwroot\Shared. Note that the root of your function app is at D:\home\site\wwwroot.

Marie Hoeger
  • 1,261
  • 9
  • 11
  • my "Shared" folder is at the same level of the function folder (the one that contain run.csx) but i don't know how to check if it is in "D:\home\site\wwwroot" – Elelio Aug 07 '18 at 06:50
  • You can see your Function App files in [Kudu](https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#kudu). Try going to `https://.scm.azurewebsites.net/`, which is just your function app url with ".scm." inserted in the middle. Then, go to "Debug console" and you'll be at the Kudu file explorer Mikhail was asking about! – Marie Hoeger Aug 07 '18 at 18:37
  • 1
    Also - if your "Shared" folder is at the same level of the _function_ folder, where run.csx is, then i think you should be referencing `#load ".\shared\data.csx"` – Marie Hoeger Aug 07 '18 at 18:38