Nuget package install using Azure App service editor - azure

My application is hosted on Azure and I using the App Service editor to do my changes and build on the cloud itself without using Visual Studio locally.
Now I would like to install a Nuget package to the project. So I tried the console option from the App Service editor. But it does not work as the console window does not recognize Nuget commands.
So after looking through the help command on App Service editor console I found these options-
cd Directory navigation
copy
del
dir
exit Closes the console
git Git source control commanding
help List of available commands
mkdir
move
msbuild MSBuild commanding
node Node.js commanding
npm Node package manager
nuget NuGet commanding
open Open file in editor
ps PowerShell commanding
rd
rename
rmdir
touch Touch a file if it exists or create it otherwise
unzip Unzip archives
Native windows commands (append /? for help):
copy Copy files
del Delete a file
move Move files
rename Rename files
dir Directory browsing
mkdir Create a directory
rmdir Delete a directory
So there seems to be nuget command but when I use it the console window is just stuck and stays like that.
Am I using the command correctly or there seems to be some problem?
I know I can download and do this locally but I am looking for a way to do this simply using the App Service editor. Any help on this please?

Try
dotnet add package RestSharp --version 106.2.2
You could check:
Usage: dotnet add <PROJECT> package [options] <PACKAGE_NAME>
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
<PACKAGE_NAME> The package reference to add.
Options:
-h, --help Show help information.
-v, --version <VERSION> Version for the package to be added.
-f, --framework <FRAMEWORK> Adds reference only when targeting a specific framework.
-n, --no-restore Adds reference without performing restore preview and compatibility check.
-s, --source <SOURCE> Specifies NuGet package sources to use during the restore.
--package-directory <PACKAGE_DIRECTORY> Restores the packages to the specified directory.

Related

How to Uninstall Eclipse IDE and the packages that were installed, during installation process in Ubuntu?

I had installed Eclipse IDE for Java, I found it difficult to use and I switched to IntelliJ Idea.
I ran this command
cd .local/share/applications/
rm *eclipse*.desktop epp*.desktop
It removed the Eclipse Ide,now are the packages also removed that were installed during installation process. If No, then how should I remove the packages ?
In the case you are using the packge by unzip and run the the sh file to start the eclipse. we can find the folder that stores the eclipse packe and delete it.
Find the folder: sudo find f . -name {1 file name you know}
After that you can remove all folder - that include this file. If you have UI you can access directly to folder to check it before remove all of them

How to install node.js in a custom directory through powershell?

I am making a script to install NodeJS on several machines through PowerShell.
By default NodeJS gets installed in C:\Program Files\nodejs folder. Can I define a custom directory for the installation?
I am running this command:
msiexec.exe /i $nodejs_download_filename /L*V "logger.log" /passive | out-null
Is there any argument to add to this line in order to specify the target directory instead of the default one?
You can refer this
Install Node.js on a different hard drive from C to D
You can move the node.exe to the d drive. Then check your environment path.
Type set in a command window or in computer properties.
Make sure you have the folder that contains node.exe in your path.
Running node in a command window will work from any folder then.
For installed npm packages, ie.. node_modules folder..
That just needs to be in a directory above where your writing your code, so try putting that folder in d:\ Assuming your going to be writing your apps on the d drive now.
In .npmrc file, change prefix setting to desired folder. Global packages get installed in node_modules under that folder.

How to run Node.js after downloading binary version for Windows

If I downloaded Windows Binary version (.zip, node-v8.11.4-win-x64) from nodejs.org and unpack the ZIP, what the next should I do? I'm newbie in NodeJS and can't find the answer in the docs
I see the file node.exe inside of unpacked folder and as I know it's so-called "repl".
Where should I create the working folder for the projects and the file hello-world.js?
And in which Windows' terminal can I run the commands?
Windows 7 Home Premium 64-bit
You should put node.exe on your system PATH, that way you can use it from any directory. Here's a guide to edit path on Windows 7:
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
You can then start it in any CMD shell or in PowerShell.
To test, start a new CMD window, and type
node -v
This should give you the node version.
I'd suggest you create something like a Projects directory for your code in your \user dir, with a subdirectory per project.
Once you've all this in place, just navigate to your project dir in your chosen shell and :
node hello-world.js

How to auto-generate deploy.cmd in new Azure CLI?

I'm following this guide to create a web app with a custom deploy.cmd file. The article suggests that I can get a copy of the current deploy.cmd file (which I'll then modify) using the following command:
azure site deploymentscript --python
Unfortunately, when I install the Azure CLI using the MSI linked in the article, there is no azure binary on my path. I do have az -- is this a newer version of the same CLI? -- but I can't find an equivalent deployment script generation command for that executable.
I found a deploy.cmd file using Kudu (under D:\home\site\deployments\tools) but am not sure if that's the appropriate file to use. Can anyone suggest the right Azure CLI command for deployment script generation, or confirm that the deploy.cmd file I found is the right one to modify? Thanks in advance!
Based on my knowledge, there is not an equivalent to azure site deploymentscript in azure cli(2.0). So, you could not do deploy custom script with Azure CLI 2.0.
You had better know the difference between Azure cli 2.0(az) with Azure cli 1.0(azure).
Azure CLI 2.0: Our next-generation CLI written in Python, for use with
the Resource Manager deployment model.
Azure CLI 1.0: Our CLI written in Node.js, for use with both the
classic and Resource Managerdeployment models.
For your scenario, if you could install Azure ClI 1.0, you could refer to this link to install Azure CLI 1.0.
Instead of using the command line to generate a starter deployment script, there is an alternative approach that is often easier:
Deploy your repo without any deployment scripts.
Go to the site's Kudu Console.
From the Tools menu, choose 'Download deployment script'. You'll get a zip with a .deployment and deploy.cmd files.
Commit both files at the root of your repo
Tweak them as needed
More information please refer to this link.
You can use kuduscript to generate the deployment script.
npm install -g kuduscript
kuduscript --python
Here is the list of options
Options:
-h, --help output usage information
-V, --version output the version number
-r, --repositoryRoot [dir path] The root path for the repository (default: .)
--aspWAP <projectFilePath> Create a deployment script for .NET web application, specify the project file path
--aspNetCore <projectFilePath> Create a deployment script for ASP.NET Core web application, specify the project file path
--aspWebSite Create a deployment script for basic website
--go Create a deployment script for Go website
--node Create a deployment script for node.js website
--ruby Create a deployment script for ruby website
--php Create a deployment script for php website
--python Create a deployment script for python website
--functionApp [projectFilePath] Create a deployment script for function App, specify the project file path if using msbuild
--basic Create a deployment script for any other website
--dotNetConsole <projectFilePath> Create a deployment script for .NET console application, specify the project file path
-s, --solutionFile <file path> The solution file path (sln)
-p, --sitePath <directory path> The path to the site being deployed (default: same as repositoryRoot)
-t, --scriptType <batch|bash|posh> The script output type (default: batch)
-o, --outputPath <output path> The path to output generated script (default: same as repository root)
-y, --suppressPrompt Suppresses prompting to confirm you want to overwrite an existing destination file.
--no-dot-deployment Do not generate the .deployment file.
--no-solution Do not require a solution file path (only for --aspWAP otherwise ignored).

How to update metadata of NuGet Package using command line?

I am using NuGet.Exe version 2.8.2 to create nuget package. After Create Package, Open with NuGet Package Explorer and I saw there is some default code inside package like in icon URL text box
http:// icon_url_here_or_delete_this_line/
To see such data follow steps as foolows
Open command Line Box (cmc.exe).
Go to folder where NuGet.exe is present.
Run Command "nuget spec abc.dll" (abc.dll must present inside folder)
once abc.dll.spec file create the run " nuget pack abc.dll.spec "
done with creating package with some warnings about that default code in metadata.
Now open that package with Nuget Package explorer you can see that metadata with some default code like I mention above.
I also refer document present in this link provided by nuget.Org.
So the question is that how to set my customize information to this metadata using command line?
NOTE :-
Please do not suggest to do it using Nuget Package Explorer because I know it I just want to use command line to do so.
I don't think NuGet.exe supports it. You can manually edit the .nuspec file in notepad, and replace the metadata like project URL; or do string replacement of the .nuspec file using powershell commands.

Resources