public static void CreateCloudService(
     this IStoreManagement proxy,
     string subscriptionId,
     string cloudServiceName,
     CloudService cloudService)
 {
     proxy.EndCreateCloudService(proxy.BeginCreateCloudService(
         subscriptionId,
         cloudServiceName,
         cloudService,
         null,
         null));
 }
Exemplo n.º 2
0
        private string CreateCloudServiceIfNotExists(string location)
        {
            string cloudServiceName = GetCloudServiceName(subscriptionId, location);
            CloudService cloudService = new CloudService()
            {
                Name = cloudServiceName,
                Label = cloudServiceName,
                Description = string.Format(Resources.CloudServiceDescription, location),
                GeoRegion = location
            };
            try
            {
                storeChannel.CreateCloudService(subscriptionId, cloudServiceName, cloudService);
                WaitForOperation(headersInspector.ResponseHeaders[ServiceManagementConstants.OperationTrackingIdHeader]);
            }
            catch (Exception)
            {
                // The CloudService is already created, ignore exception.
            }

            return cloudServiceName;
        }