aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/MainWindow.xaml.cs
blob: 2ba632f76fb54348d4b9472946a9a307952e8051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.AzureUtils.UI
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private static string app_id = "be33437c-5052-449f-ab9d-a88d008eae24";
        private static string client_secret = "bf67fb6f-4d06-4893-988c-6b347aff23d6";
        private static string tenant_id = "2ebd63a5-bc2f-41dc-9066-4409ed5e5dd4";
        private static string subscription_id = "10c8aa60-3b15-4e0d-b412-6aeef90e5e91";

        Tango.AzureUtils.Deployment.DeploymentManager manager = new Deployment.DeploymentManager(new AzureUtilsCredentials()
        {
            ClientID = app_id,
            ClientSecret = client_secret,
            TenantID = tenant_id,
            SubscriptionID = subscription_id
        });

        public MainWindow()
        {
            InitializeComponent();

            Test();
        }

        private async void Test()
        {
            var apps = await manager.GetAllWebAppsAsync();

            var machineService = apps.SingleOrDefault(x => x.Name == "MachineService");

            var devSlot = await machineService.DeploymentSlots.GetByNameAsync("MachineService-DEV");
            var testSlot = await machineService.DeploymentSlots.GetByNameAsync("MachineService-TEST");

            await manager.OpenSQLExaminerData(devSlot, testSlot);

            var a = 5;
        }
    }
}