How to get local file system path in azure websites -
i have file hosted on disk along website want read .not sure how access file when utilize system.environment.currentdirectory point d drive location .can please tell me how can file stored @ root of site hosted.
thanks
there environment variable called home in website's environment part way there.
you can access using razor syntax or in code (c#). example, suppose have file called data.txt @ root of site default document , rest of files. it's total path this.
@{ var datafilename = environment.getenvironmentvariable("home").tostring() + "\\site\\wwwroot\\data.txt"; }
you can find out on own using site command management/"kudu". example, if website contoso.azurewebsites.net, navigate contoso.scm.azurewebsites.net. in here can larn file scheme , environment variables available website.
azure
No comments:
Post a Comment