How do I reference a text file from an Azure WebJob? - azure

I'm creating a web job on Azure that is going to be a c# console application (.exe). Inside this program I need to read a text file from the file system. Is there a way to include the text file I need in the executable? Where do I put the file and how do I reference it?
I also don't want anyone (via the website) be able to access the file.

Just deploy the text file alongside the executable, and you'll be able to open it in the current folder.
If deploying the WebJob from Visual Studio, make sure to mark the text file's properties as 'Copy if newer' to make sure it gets deployed.

Follow instead of putting a file location in the value as parameter
just put this as I show you here
Put it in Appconfig file for path as
to copy this text file into your bin/debug folder to
Make zip folder as usual, put that test file int "debug.zip"

Related

Unzip and Rename underlying File using Azure Logic App

Possible to rename an underlying file while Unzipping using Logic App? I am calling an HTTP activity to download a ZIP file. That Zip contains only 1 Underlying file with some value appended to the name. I want to store the Unzipped file with a better name so that it can be used further. Is it possible ?
Incoming ZIP File --> SAMPLEFile.ZIP
Underlying File --> SampleTextFile20200824121212.TXT
Desired File --> SampleTextFile.TXT
Suggestions ?
As far as I know, we can't implement this requirement directly in "Extract archive to folder" action. We can just rename the file by copy it from one folder to another folder (shown as below).
You can create a new ticket on feedback page to ask azure team for this feature.

Can we save files in local when developing custom functions?

I am following this link to try custom functions.
First I put customfunctions.js and customfunctions.html in my local folder, and then replace https://<INSERT-URL-HERE> in the manifest file with their path: I tried \\SOFTTIMUR9FDC\Users\SoftTimur\tmp\EXCEL-CUSTOM-FUNCTIONS and \\Mac\Home\tmp\EXCEL-CUSTOM-FUNCTIONS\, but I could not see any application in SHARED FOLDER in Excel.
Then, I put these 2 files on a website, and then replace https://<INSERT-URL-HERE> in the manifest file with their https address. Now, it worked; I could see the application in SHARED FOLDER in Excel and the custom functions worked.
So is it expected? In other words, when we test custom functions, we could not save these files in LOCAL; we have to save them in a website?
PS: when we develop a normal excel add-in, there is no problem to save the source files in local.
It's possible to host your customfunctions.html file locally, yes. From your description, it sounds like there's something wrong with how you're deploying the manifest, or with the manifest itself. Verify that your only change was the URL for those files, and that it worked properly otherwise.

How to do Text file changes in a ZIP file in InstallShield Basic MSI project

How to do Text file changes in a ZIP file in InstallShield Basic MSI project. I am not able to do Text file changes in a file which is inside a zipped file.
InstallShield does not offer this capability, at least not now. You will have to either surround the call to the text-file-changing custom action with ones that extract and replace the zipped file (the text file changes would operate on the temporary copy), or implement the whole thing yourself in one step. I'm not sure which approach will be easier.
In your situation, I would reframe the design and requirement. Silverlight .XAP files are typically digitally signed. Any attempt to modify the archive would invalidate this. It's also needlessly complicated.
Instead, change your application to use an external configuration file. native InstallShield functionality can then be used to update this file. For a possible approach, see:
Creating and Using Silverlight web.config app settings (Web.config Configuration Applicatioin Settings) or app.config application settings configuration file for Silverlight

Can I keep the application settings when updating with installshield?

I finally managed to get my application updating through installshield LE, without the user having to uninstall manually first, what I am now wondering is:
Can I get the installer to use the application settings from the previous install, so the users saved settings don't change, causing the user to enter their settings every time there is an update. But at the same time, add any new settings to the config file.
Is there anyway to get the installer to not update certain files, for example, the database file is held in a folder called 'db' inside the program files directory, I obviously don't want the users database getting overwritten with a blank one.
Thank you.
Im not sure what programming language you are writing in, but I had this concern with a C# application I wrote. I see 2 easy ways of doing it:
1) With C# you can setup application setting variables that get written to an XML file in the users Application Data (on WinXP) directory. The nice thing about this is that writing to and reading from the settings file is really easy through the API:
To save and store a variable:
Properties.Settings.Default.UserName = UserName_txtbox.Text; // save contents of UserName_txtbox to UserName setting variable
Properties.Settings.Default.Save(); // write variable to file
To restore a variable:
UserName_txtbox.Text = Properties.Settings.Default.UserName; //load contents of UserName variable to UserName_txtbox
Because the file that contains these are not included in the installation directory of the application, they are preserved.
If you are using a different programming language, you can try to implement the same concept.
Create a settings file that your program updates externally from the install location. (Perhaps it can be in the install location. Im not sure how your installer "updates". Does it replace files or uninstall the old version and install the new version automatically? Play this this to find out...)
Your settings file can be a simple txt file, a bin file, an XML file, etc. Anything that you can read and parse easily. Then you can load settings from the file when the program loads and save settings to the file when the program exits.

Copy external linked file to a root of a web site

In Visual Studio 2012
I have three web sites that all use the same set of database connection strings.
I keep database connections strings in a connectionStrings.config file which is in a common solution folder (external to all three web sites).
I included this file as a link (configured as Content and Copy Always) - which copies connectionString.config file to each web site's bin folder when I compile/run web site.
I would like to copy that file to the root of each web site instead. Is there an easy way to accomplish that?
One way to do this is to use xcopy in post-build step of the project.
The other solution would be to modify .csproj file (or a separate, external .target file) to copy linked file to the root (instead of to $(OutputDir))
I used a Post-Build event. It has macro's for the place you want the file to end up.
Just use the $(Macro) tags with a few "..", and you can "massage" the files to where you want them.
copy $(ProjectDir)..\connectionStrings.config $(TargetDir)connectionStrings.config

Resources