We can use git pull command to get the updates from other git repository. In Azure kudu, the command could be like this,
D:\home\site\wwwroot>git remote add gitsource https://[email protected]/xx.git
D:\home\site\wwwroot>git pull gitsource master
When we release the newer version of the application, how can we provide the seamless upgrade to our customers
After released the new version of your application, you could force your client to execute upper command to get the updates. If you use C# as your programming language, you could use following steps to execute powershell command.
- Install System.Management.Automation dll using NuGet.
- Run powershell scripts using following method.
private static string RunScript(string scripts)
{
// create Powershell runspace
Runspace runspace = RunspaceFactory.CreateRunspace();
// open it
runspace.Open();
// create a pipeline and feed it the script text
Pipeline pipeline = runspace.CreatePipeline();
pipeline.Commands.AddScript(scripts);
pipeline.Commands.Add("Out-String");
//execute the script
Collection<PSObject> results = pipeline.Invoke();
//close the runspace
runspace.Close();
// convert the script result into a single string
StringBuilder stringBuilder = new StringBuilder();
foreach (PSObject obj in results)
{
stringBuilder.AppendLine(obj.ToString());
}
return stringBuilder.ToString();
}