aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Azure/Tango.AzureUtils
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-07-28 15:50:27 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-07-28 15:50:27 +0300
commit0281068b4adb3f94af50f2c758d3e0fa0fe5f191 (patch)
tree63d1dcc9ce546722beb7689739a94194556013ba /Software/Visual_Studio/Azure/Tango.AzureUtils
parent7c7aba43ab895d02e0209861550fed3bc12f3904 (diff)
downloadTango-0281068b4adb3f94af50f2c758d3e0fa0fe5f191.tar.gz
Tango-0281068b4adb3f94af50f2c758d3e0fa0fe5f191.zip
Added machine service version display to AzureUtils.
Diffstat (limited to 'Software/Visual_Studio/Azure/Tango.AzureUtils')
-rw-r--r--Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs
index 5a174dcb2..021426d12 100644
--- a/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs
+++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/FTP/FtpManager.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Security.Authentication;
using System.Text;
@@ -115,5 +116,21 @@ namespace Tango.AzureUtils.FTP
var downloadResults = await DownloadWebAppFiles(sourceApp, webAppFilesTempFolder);
var uploadResults = await UploadWebAppFiles(targetApp, webAppFilesTempFolder);
}
+
+ public async Task<String> GetMachineServiceVersion(IWebAppBase app)
+ {
+ var exeTempFile = TemporaryManager.CreateImaginaryFile(".dll");
+
+ var profile = await app.GetPublishingProfileAsync();
+
+ using (var ftp = CreateFtpClient(profile.FtpUrl, profile.FtpUsername, profile.FtpPassword))
+ {
+ await ftp.ConnectAsync();
+ await ftp.DownloadFileAsync(exeTempFile, "/site/wwwroot/bin/Tango.MachineService.dll");
+ String version = FileVersionInfo.GetVersionInfo(exeTempFile).ProductVersion;
+ await exeTempFile.DeleteAsync();
+ return version;
+ }
+ }
}
}