Exemple #1
0
        // GET /api/hostedservice/subscriptionId/certificateBytes/serviceName
        public HostedService Get(string subscriptionId, List <Byte> certificateBytes, string serviceName)
        {
            HostedService hostedService = null;

            try
            {
                HostedServiceHelper hostedServiceHelper = new HostedServiceHelper();

                hostedService = hostedServiceHelper.GetHostedService(subscriptionId, certificateBytes, serviceName);
            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("Error occurred in HostedServiceController.Get(string subscriptionId, Byte[] certificateBytes, string serviceName)  Error: {0}", ex.Message));

                hostedService = null;
            }

            return(hostedService);
        }
        public void GetHostedServiceTest()
        {
            HostedServiceHelper target = new HostedServiceHelper();

            string subscriptionId = "32e65da4-1eaf-4073-940a-51d7357d321b";

            string filePath = @"C:\Development\Certificates\AzureManagementCertificate.cer";

            List <Byte> certificateBytes = CertificateUtility.GetCertificateBytes(filePath);

            string serviceName = "evoappweb";

            HostedService expected = null;
            HostedService actual;

            actual = target.GetHostedService(subscriptionId, certificateBytes, serviceName);

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void CreateHostedServiceTest()
        {
            HostedServiceHelper target = new HostedServiceHelper();

            string subscriptionId = "e57cc5fa-5cf7-41c0-a33c-3adaf2944c4a";
            string thumbprint     = "AEBCC83D2678B39712BFEAC43D7DA94140D2FCE6";

            string serviceName = "commandlinetest";

            string label = "Hosted Service Test 2.0";

            string description = "Test Hosted Service Creation";

            string location = "North Central US";

            string affinityGroup = string.Empty;

            string expected = string.Empty;
            string actual;

            actual = target.CreateHostedService(subscriptionId, thumbprint, serviceName, label, description, location, affinityGroup);

            Assert.AreEqual(expected, actual);
        }