/// <summary>
        /// Initializes a new instance of the PublishAzureServiceCommand class.
        /// </summary>
        /// <param name="channel">
        /// Channel used for communication with Azure's service management APIs.
        /// </param>
        public PublishAzureServiceProjectCommand(IServiceManagement channel)
        {
            // This instantiation will throw if user is running with incompatible Windows Azure SDK version.
            new AzureTools.AzureTool();

            Channel = channel;
        }
Example #2
0
        /// <summary>
        /// Removes uploaded package from storage account.
        /// </summary>
        /// <param name="channel">Channel to use for REST calls</param>
        /// <param name="storageName">Store which has the package</param>
        /// <param name="subscriptionId">Subscription which has the store</param>
        public static void RemovePackageFromBlob(IServiceManagement channel, string storageName, string subscriptionId)
        {
            StorageService storageService = channel.GetStorageKeys(subscriptionId, storageName);
            string storageKey = storageService.StorageServiceKeys.Primary;

            RemoveFile(storageName, storageKey);
        }
        /// <summary>
        /// Initializes a new instance of the PublishAzureServiceCommand class.
        /// </summary>
        /// <param name="channel">
        /// Channel used for communication with Azure's service management APIs.
        /// </param>
        public PublishAzureServiceProjectCommand(IServiceManagement channel)
        {
            Channel = channel;

            _listeners = new List<IPublishListener>();
            _listeners.Add(new CachingStorageConnectionStringUpdater());
        }
        public static CloudStorageAccount GetCurrentCloudStorageAccount(IServiceManagement channel, SubscriptionData subscriptionData)
        {
            if (String.IsNullOrEmpty(subscriptionData.CurrentStorageAccount))
            {
                return null;
            }

            if (subscriptionData.CurrentCloudStorageAccount != null)
            {
                return subscriptionData.CurrentCloudStorageAccount;
            }

            CloudStorageAccount currentStorage = null;
            using (new OperationContextScope(channel.ToContextChannel()))
            {
                var storageService = channel.GetStorageService(subscriptionData.SubscriptionId, subscriptionData.CurrentStorageAccount);
                var storageServiceKeys = channel.GetStorageKeys(subscriptionData.SubscriptionId, subscriptionData.CurrentStorageAccount);
                if (storageService != null && storageServiceKeys != null)
                {
                    string connectionString = General.BuildConnectionString("https", storageService.ServiceName, storageServiceKeys.StorageServiceKeys.Primary, storageService.StorageServiceProperties.Endpoints[0].Replace("http://", "https://"), storageService.StorageServiceProperties.Endpoints[2].Replace("http://", "https://"), storageService.StorageServiceProperties.Endpoints[1].Replace("http://", "https://"));
                    currentStorage = CloudStorageAccount.Parse(connectionString);
                }
            }

            subscriptionData.CurrentCloudStorageAccount = currentStorage;
            return currentStorage;
        }
Example #5
0
        public static Uri UploadPackageToBlob(IServiceManagement channel, string storageName, string subscriptionId, string packagePath, BlobRequestOptions blobRequestOptions)
        {
            StorageService storageService = channel.GetStorageKeys(subscriptionId, storageName);
            string storageKey = storageService.StorageServiceKeys.Primary;

            return UploadFile(storageName, storageKey, packagePath, blobRequestOptions);
        }
Example #6
0
 public static void DeletePackageFromBlob(
     IServiceManagement channel,
     string storageName,
     string subscriptionId,
     Uri packageUri)
 {
     cloudBlobUtility.DeletePackageFromBlob(channel, storageName, subscriptionId, packageUri);
 }
Example #7
0
		public static Uri UploadPackageToBlob(IServiceManagement channel, string storageName, string subscriptionId, string packagePath)
		{
			StorageService storageKeys = channel.GetStorageKeys(subscriptionId, storageName);
			string primary = storageKeys.StorageServiceKeys.Primary;
			storageKeys = channel.GetStorageService(subscriptionId, storageName);
			EndpointList endpoints = storageKeys.StorageServiceProperties.Endpoints;
			string str = ((List<string>)endpoints).Find((string p) => p.Contains(".blob."));
			return AzureBlob.UploadFile(storageName, primary, str, packagePath);
		}
Example #8
0
 protected override void PerformOperation(IServiceManagement channel)
 {
     var operation = channel.GetOperationStatus(SubscriptionId, OperationId);
     Console.WriteLine("Requested Status={0}", operation.Status);
     if (operation.Error != null)
     {
         Console.WriteLine(operation.Error);
     }
 }
Example #9
0
        public static Uri UploadPackageToBlob(IServiceManagement channel, string storageName, string subscriptionId, string packagePath)
        {
            StorageService storageService = null;

            storageService = channel.GetStorageKeys(subscriptionId, storageName);
            string storageKey = storageService.StorageServiceKeys.Primary;

            return AzureBlob.UploadFile(storageName, storageKey, packagePath);
        }
        public Conexao(string usuario, string senha, string servidor)
        {
            credentials = new ClientCredentials();
            uri = new Uri("https://" + servidor + "/XRMServices/2011/Organization.svc");

            credentials.Windows.ClientCredential = new NetworkCredential(usuario, senha);
            orgServiceManagement = ObterOrganizationService();
            EstaConectado = true;
        }
Example #11
0
        public static Uri UploadPackageToBlob(IServiceManagement channel, string storageName, string subscriptionId, string packagePath, BlobRequestOptions blobRequestOptions)
        {
            StorageService storageService = channel.GetStorageKeys(subscriptionId, storageName);
            string storageKey = storageService.StorageServiceKeys.Primary;
            storageService = channel.GetStorageService(subscriptionId, storageName);
            string blobEndpointUri = storageService.StorageServiceProperties.Endpoints[0];

            return UploadFile(storageName, CreateHttpsEndpoint(blobEndpointUri), storageKey, packagePath, blobRequestOptions);
        }
Example #12
0
        protected override void PerformOperation(IServiceManagement channel)
        {
            var input = new CertificateFile()
            {
                CertificateFormat = CertificateFormat,
                Password = CertificateFilePassword,
            };

            input.Data = Convert.ToBase64String(File.ReadAllBytes(CertificateFile));
            channel.AddCertificates(SubscriptionId, HostedServiceName, input);
        }
 public static void DeletePackageFromBlob(IServiceManagement channel, string storageName, string subscriptionId, Uri packageUri)
 {
     var storageService = channel.GetStorageKeys(subscriptionId, storageName);
     var storageKey = storageService.StorageServiceKeys.Primary;
     storageService = channel.GetStorageService(subscriptionId, storageName);
     var blobStorageEndpoint = new Uri(storageService.StorageServiceProperties.Endpoints.Find(p => p.Contains(BlobEndpointIdentifier)));
     var credentials = new StorageCredentials(storageName, storageKey);
     var client = new CloudBlobClient(blobStorageEndpoint, credentials);
     ICloudBlob blob = client.GetBlobReferenceFromServer(packageUri);
     blob.DeleteIfExists();
 }
Example #14
0
		public static void DeletePackageFromBlob(IServiceManagement channel, string storageName, string subscriptionId, Uri packageUri)
		{
			StorageService storageKeys = channel.GetStorageKeys(subscriptionId, storageName);
			string primary = storageKeys.StorageServiceKeys.Primary;
			storageKeys = channel.GetStorageService(subscriptionId, storageName);
			EndpointList endpoints = storageKeys.StorageServiceProperties.Endpoints;
			string str = ((List<string>)endpoints).Find((string p) => p.Contains(".blob."));
			StorageCredentialsAccountAndKey storageCredentialsAccountAndKey = new StorageCredentialsAccountAndKey(storageName, primary);
			CloudBlobClient cloudBlobClient = new CloudBlobClient(str, storageCredentialsAccountAndKey);
			CloudBlob blobReference = cloudBlobClient.GetBlobReference(packageUri.AbsoluteUri);
			blobReference.DeleteIfExists();
		}
Example #15
0
 public static Uri UploadPackageToBlob(
     IServiceManagement channel,
     string storageName,
     string subscriptionId,
     string packagePath,
     BlobRequestOptions blobRequestOptions)
 {
     return cloudBlobUtility.UploadPackageToBlob(
         channel,
         storageName,
         subscriptionId,
         packagePath,
         blobRequestOptions);
 }
Example #16
0
		public static void RemoveVHD(IServiceManagement channel, string subscriptionId, Uri mediaLink)
		{
			StorageService storageKeys;
			char[] chrArray = new char[1];
			chrArray[0] = '.';
			string str = mediaLink.Host.Split(chrArray)[0];
			string components = mediaLink.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped);
			using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)channel))
			{
				storageKeys = channel.GetStorageKeys(subscriptionId, str);
			}
			StorageCredentialsAccountAndKey storageCredentialsAccountAndKey = new StorageCredentialsAccountAndKey(str, storageKeys.StorageServiceKeys.Primary);
			CloudBlobClient cloudBlobClient = new CloudBlobClient(components, storageCredentialsAccountAndKey);
			CloudBlob blobReference = cloudBlobClient.GetBlobReference(mediaLink.AbsoluteUri);
			blobReference.DeleteIfExists();
		}
Example #17
0
        public static void RemoveVHD(IServiceManagement channel, string subscriptionId, Uri mediaLink)
        {
            var accountName = mediaLink.Host.Split('.')[0];
            var blobEndpoint = new Uri(mediaLink.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped));

            StorageService storageService;
            using (new OperationContextScope(channel.ToContextChannel()))
            {
                storageService = channel.GetStorageKeys(subscriptionId, accountName);
            }

            var storageAccountCredentials = new StorageCredentials(accountName, storageService.StorageServiceKeys.Primary);
            var client = new CloudBlobClient(blobEndpoint, storageAccountCredentials);
            var blob = client.GetBlobReferenceFromServer(mediaLink);
            blob.DeleteIfExists();
        }
        public static CloudStorageAccount GetCurrentCloudStorageAccount(
            IServiceManagement channel,
            SubscriptionData subscriptionData)
        {
            if (String.IsNullOrEmpty(subscriptionData.CurrentStorageAccount))
            {
                return null;
            }

            if (subscriptionData.CurrentCloudStorageAccount != null)
            {
                return subscriptionData.CurrentCloudStorageAccount;
            }

            SetCurrentCloudStorageAccount(channel, subscriptionData);

            return subscriptionData.CurrentCloudStorageAccount;
        }
Example #19
0
        protected override void PerformOperation(IServiceManagement channel)
        {
            CreateHostedServiceInput input = new CreateHostedServiceInput()
            {
                ServiceName = HostedServiceName,
                Label = ServiceManagementHelper.EncodeToBase64String(CSManageCommand.Label),

            };

            if (CSManageCommand.Description != null)
            {
                Description = CSManageCommand.Description;
            }

            if (LocationConstraintName != null)
            {
                input.Location = LocationConstraintName;
            }
            try
            {
                channel.CreateHostedService(SubscriptionId, input);
            }
            catch (ProtocolException e)
            {
                ServiceManagementError error = null;
                System.Net.HttpStatusCode httpStatusCode = 0;
                string operationId;
                ServiceManagementHelper.TryGetExceptionDetails(e, out error, out httpStatusCode, out operationId);
                if (httpStatusCode != HttpStatusCode.Conflict)
                {
                    base.RethrowCommunicationError(e, error);
                }

                var myservices = channel.ListHostedServices(SubscriptionId);
                if ((from s in myservices select s.ServiceName).Contains(HostedServiceName))
                {
                    throw new CSManageException("The hosted service " + HostedServiceName + " already exists.");
                }
                else
                {
                    throw new CSManageException("A hosted service by the name " + HostedServiceName + " is already in use by another Subscription. Please choose a different name.", e);
                }
            }
        }
        public ExtensionManager(IServiceManagement channel, string subscriptionId, string serviceName)
        {
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }
            Channel = channel;

            if (string.IsNullOrEmpty(subscriptionId))
            {
                throw new ArgumentNullException("subscriptionId");
            }
            SubscriptionId = subscriptionId;

            if (string.IsNullOrEmpty(serviceName))
            {
                throw new ArgumentNullException("serviceName");
            }
            ServiceName = serviceName;
        }
        public void OnPublish(IServiceManagement channel, AzureService service, ServiceSettings publishSettings, string subscriptionId)
        {
            StorageService storageService = channel.GetStorageKeys(subscriptionId, publishSettings.StorageAccountName);
            string name = publishSettings.StorageAccountName;
            string key = storageService.StorageServiceKeys.Primary;

            ConfigConfigurationSetting connectionStringConfig = new ConfigConfigurationSetting { name = Resources.CachingConfigStoreConnectionStringSettingName, value = string.Empty };
            service.Components.ForEachRoleSettings(
            r => Array.Exists<ConfigConfigurationSetting>(r.ConfigurationSettings, c => c.Equals(connectionStringConfig)),
            delegate(RoleSettings r)
            {
                int index = Array.IndexOf<ConfigConfigurationSetting>(r.ConfigurationSettings, connectionStringConfig);
                r.ConfigurationSettings[index] = new ConfigConfigurationSetting
                {
                    name = Resources.CachingConfigStoreConnectionStringSettingName,
                    value = string.Format(Resources.CachingConfigStoreConnectionStringSettingValue, name, key)
                };
            });

            service.Components.Save(service.Paths);
        }
Example #22
0
        /// <summary>
        /// Creates new instance from the store client.
        /// </summary>
        /// <param name="subscriptionId">The Windows Azure subscription id</param>
        /// <param name="storeEndpointUri">The service management endpoint uri</param>
        /// <param name="cert">The authentication certificate</param>
        /// <param name="logger">The logger for http request/response</param>
        /// <param name="serviceManagementChannel">The service management channel</param>
        public StoreClient(
            string subscriptionId,
            string storeEndpointUri,
            X509Certificate2 cert,
            Action<string> logger,
            IServiceManagement serviceManagementChannel)
        {
            Validate.ValidateStringIsNullOrEmpty(storeEndpointUri, null, true);
            Validate.ValidateStringIsNullOrEmpty(subscriptionId, null, true);
            Validate.ValidateNullArgument(cert, Resources.NullCertificateMessage);

            this.subscriptionId = subscriptionId;
            headersInspector = new HeadersInspector();
            storeChannel = ChannelHelper.CreateServiceManagementChannel<IStoreManagement>(
                ConfigurationConstants.WebHttpBinding(0),
                new Uri(storeEndpointUri),
                cert,
                new HttpRestMessageInspector(logger),
                headersInspector);
            this.serviceManagementChannel = serviceManagementChannel;
            MarketplaceClient = new MarketplaceClient();
        }
Example #23
0
 public static void ReimageDeploymentRoleInstanceBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, string roleInstanceName)
 {
     proxy.EndReimageDeploymentRoleInstanceBySlot(proxy.BeginReimageDeploymentRoleInstanceBySlot(subscriptionId, serviceName, deploymentSlot, roleInstanceName, null, null));
 }
Example #24
0
 public static void RebootDeploymentRoleInstance(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentName, string roleInstanceName)
 {
     proxy.EndRebootDeploymentRoleInstance(proxy.BeginRebootDeploymentRoleInstance(subscriptionId, serviceName, deploymentName, roleInstanceName, null, null));
 }
 /// <summary>
 /// Manages an established <see cref="IDiscoveryService"/> configuration using DefaultNetworkCredentials
 /// </summary>
 /// <param name="serviceManagement">The established service configuration management object</param>
 /// <remarks>
 /// This approach authenticates using DefaultNetworkCredentials (AD) since no credentials are supplied
 /// </remarks>
 public DiscoveryServiceManager(IServiceManagement <IDiscoveryService> serviceManagement)
     : base(serviceManagement)
 {
 }
Example #26
0
        // This file is used for backwards compatibility with tests after the synchronous Service Management operations were moved off of the interface to a separate class.
        // New tests should use the full ServiceManagementClient when possible

        #region Affinity Groups

        public static void CreateAffinityGroup(this IServiceManagement proxy, string subscriptionId, CreateAffinityGroupInput input)
        {
            proxy.EndCreateAffinityGroup(proxy.BeginCreateAffinityGroup(subscriptionId, input, null, null));
        }
Example #27
0
 public GetAzureServiceDiagnosticsExtensionCommand(IServiceManagement channel)
     : base(channel)
 {
 }
Example #28
0
 public static Disk CreateDisk(this IServiceManagement proxy, string subscriptionID, Disk disk)
 {
     return(proxy.EndCreateDisk(proxy.BeginCreateDisk(subscriptionID, disk, null, null)));
 }
Example #29
0
 public static Disk GetDisk(this IServiceManagement proxy, string subscriptionID, string diskName)
 {
     return(proxy.EndGetDisk(proxy.BeginGetDisk(subscriptionID, diskName, null, null)));
 }
 public CloudStorageAccount GetCurrentStorageAccount(IServiceManagement channel)
 {
     return GetCurrentCloudStorageAccount(channel, this);
 }
Example #31
0
 public static void GetPackageBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, string containerUri, bool overwriteExisting)
 {
     proxy.EndGetPackageBySlot(proxy.BeginGetPackageBySlot(subscriptionId, serviceName, deploymentSlot, containerUri, overwriteExisting, null, null));
 }
 /// <summary>
 /// Manages an established service configuration using DefaultNetworkCredentials
 /// </summary>
 /// <param name="serviceManagement">The established service configuration management object</param>
 /// <remarks>
 /// This approach authenticates using default network credentials (AD) since no credentials are supplied
 /// </remarks>
 protected XrmServiceManager(IServiceManagement <TService> serviceManagement)
     : this(serviceManagement, null)
 {
 }
Example #33
0
 public RemoveAzureDeploymentCommand(IServiceManagement channel)
 {
     this.Channel = channel;
 }
Example #34
0
        private AuthenticationCredentials GetCredentials <TService>(string userName, string password, string domain, IServiceManagement <TService> service, AuthenticationProviderType endpointType)
        {
            AuthenticationCredentials authCredentials = new AuthenticationCredentials();

            switch (endpointType)
            {
            case AuthenticationProviderType.ActiveDirectory:
                authCredentials.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(userName, password, domain);
                break;

            case AuthenticationProviderType.LiveId:
                authCredentials.ClientCredentials.UserName.UserName = userName;
                authCredentials.ClientCredentials.UserName.Password = password;
                authCredentials.SupportingCredentials = new AuthenticationCredentials();
                authCredentials.SupportingCredentials.ClientCredentials = Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice();
                break;

            default:     // For Federated and OnlineFederated environments.
                authCredentials.ClientCredentials.UserName.UserName = userName;
                authCredentials.ClientCredentials.UserName.Password = password;
                // For OnlineFederated single-sign on, you could just use current UserPrincipalName instead of passing user name and password.
                // authCredentials.UserPrincipalName = UserPrincipal.Current.UserPrincipalName;  // Windows Kerberos

                // The service is configured for User Id authentication, but the user might provide Microsoft
                // account credentials. If so, the supporting credentials must contain the device credentials.
                if (endpointType == AuthenticationProviderType.OnlineFederation)
                {
                    IdentityProvider provider = service.GetIdentityProvider(authCredentials.ClientCredentials.UserName.UserName);
                    if (provider != null && provider.IdentityProviderType == IdentityProviderType.LiveId)
                    {
                        authCredentials.SupportingCredentials = new AuthenticationCredentials();
                        authCredentials.SupportingCredentials.ClientCredentials = Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice();
                    }
                }

                break;
            }

            return(authCredentials);
        }
Example #35
0
 public StartAzureVMCommand(IServiceManagement channel)
 {
     Channel = channel;
 }
 public SaveAzureVMImageCommand(IServiceManagement channel)
 {
     Channel = channel;
 }
Example #37
0
 public static DiskList ListDisks(this IServiceManagement proxy, string subscriptionID)
 {
     return(proxy.EndListDisks(proxy.BeginListDisks(subscriptionID, null, null)));
 }
 public SetAzureSolrStorageAccountCommand(IServiceManagement channel)
 {
     base.Channel = channel;
 }
Example #39
0
 public static Disk UpdateDisk(this IServiceManagement proxy, string subscriptionID, string diskName, Disk disk)
 {
     return(proxy.EndUpdateDisk(proxy.BeginUpdateDisk(subscriptionID, diskName, disk, null, null)));
 }
 public RemoveAzureDeploymentCommand(IServiceManagement channel)
 {
     Channel = channel;
 }
Example #41
0
 public static void DeleteDiskEx(this IServiceManagement proxy, string subscriptionID, string diskName, string comp)
 {
     proxy.EndDeleteDiskEx(proxy.BeginDeleteDiskEx(subscriptionID, diskName, comp, null, null));
 }
 /// <summary>
 /// Manages an established <see cref="IOrganizationService"/> configuration using DefaultNetworkCredentials
 /// </summary>
 /// <param name="serviceManagement">The established service configuration management object</param>
 /// <remarks>
 /// This approach authenticates using DefaultNetworkCredentials (AD) since no credentials are supplied
 /// </remarks>
 public OrganizationServiceManager(IServiceManagement <IOrganizationService> serviceManagement)
     : base(serviceManagement)
 {
 }
Example #43
0
 public static void DeleteAffinityGroup(this IServiceManagement proxy, string subscriptionId, string affinityGroupName)
 {
     proxy.EndDeleteAffinityGroup(proxy.BeginDeleteAffinityGroup(subscriptionId, affinityGroupName, null, null));
 }
 public NewAzureAffinityGroupCommand(IServiceManagement channel)
 {
     base.Channel = channel;
 }
 /// <summary>
 /// Manages an established <see cref="IOrganizationService"/> configuration using supplied <see cref="AuthenticationCredentials"/>
 /// </summary>
 /// <param name="serviceManagement">The established service configuration management object</param>
 /// <param name="credentials">The auth credentials</param>
 /// <remarks>
 /// <see cref="AuthenticationCredentials"/> can represent AD, Claims, or Cross-realm Claims <see cref="ClientCredentials"/>
 /// The authCredentials may already contain a <see cref="SecurityTokenResponse"/>
 /// For cross-realm (federated) scenarios it can contain a HomeRealm Uri by itself, or also include a <see cref="SecurityTokenResponse"/> from the federated realm
 /// </remarks>
 public OrganizationServiceManager(IServiceManagement <IOrganizationService> serviceManagement, AuthenticationCredentials credentials)
     : base(serviceManagement, credentials)
 {
 }
Example #46
0
 public static void UpgradeDeployment(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentName, UpgradeDeploymentInput input)
 {
     proxy.EndUpgradeDeployment(proxy.BeginUpgradeDeployment(subscriptionId, serviceName, deploymentName, input, null, null));
 }
Example #47
0
 public static void WalkUpgradeDomainBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, WalkUpgradeDomainInput input)
 {
     proxy.EndWalkUpgradeDomainBySlot(proxy.BeginWalkUpgradeDomainBySlot(subscriptionId, serviceName, deploymentSlot, input, null, null));
 }
Example #48
0
 public static void RollbackDeploymentUpdateOrUpgradeBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string slotName, RollbackUpdateOrUpgradeInput input)
 {
     proxy.EndRollbackDeploymentUpdateOrUpgradeBySlot(proxy.BeginRollbackDeploymentUpdateOrUpgradeBySlot(subscriptionId, serviceName, slotName, input, null, null));
 }
Example #49
0
 public static void DeleteDeploymentBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot)
 {
     proxy.EndDeleteDeploymentBySlot(proxy.BeginDeleteDeploymentBySlot(subscriptionId, serviceName, deploymentSlot, null, null));
 }
 /// <summary>
 /// Manages an established <see cref="IDiscoveryService"/> configuration using supplied <see cref="AuthenticationCredentials"/>
 /// </summary>
 /// <param name="serviceManagement">The established service configuration management object</param>
 /// <param name="credentials">The auth credentials</param>
 /// <remarks>
 /// <see cref="AuthenticationCredentials"/> can represent AD, Claims, or Cross-realm Claims <see cref="ClientCredentials"/>
 /// The authCredentials may already contain a <see cref="SecurityTokenResponse"/>
 /// For cross-realm (federated) scenarios it can contain a HomeRealm Uri by itself, or also include a <see cref="SecurityTokenResponse"/> from the federated realm
 /// </remarks>
 public DiscoveryServiceManager(IServiceManagement <IDiscoveryService> serviceManagement, AuthenticationCredentials credentials)
     : base(serviceManagement, credentials)
 {
 }
		public SetAzureVNetConfigCommand(IServiceManagement channel)
		{
			base.Channel = channel;
		}
Example #52
0
 public static Deployment GetDeploymentBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot)
 {
     return(proxy.EndGetDeploymentBySlot(proxy.BeginGetDeploymentBySlot(subscriptionId, serviceName, deploymentSlot, null, null)));
 }
        private static void SetCurrentCloudStorageAccount(IServiceManagement channel, SubscriptionData subscriptionData)
        {
            CloudStorageAccount currentStorage = null;
            using (new OperationContextScope((IContextChannel)channel))
            {
                var storageService = channel.GetStorageService(
                    subscriptionData.SubscriptionId,
                    subscriptionData.CurrentStorageAccount);
                var storageServiceKeys = channel.GetStorageKeys(
                    subscriptionData.SubscriptionId,
                    subscriptionData.CurrentStorageAccount);

                if (storageService != null && storageServiceKeys != null)
                {
                    currentStorage = new CloudStorageAccount(new StorageCredentials(
                        storageService.ServiceName,
                        storageServiceKeys.StorageServiceKeys.Primary),
                        General.CreateHttpsEndpoint(storageService.StorageServiceProperties.Endpoints[0]),
                        General.CreateHttpsEndpoint(storageService.StorageServiceProperties.Endpoints[1]),
                        General.CreateHttpsEndpoint(storageService.StorageServiceProperties.Endpoints[2]));
                }
            }

            subscriptionData.CurrentCloudStorageAccount = currentStorage;
        }
Example #54
0
 public static void SuspendDeploymentUpdateOrUpgrade(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentName)
 {
     proxy.EndSuspendDeploymentUpdateOrUpgrade(proxy.BeginSuspendDeploymentUpdateOrUpgrade(subscriptionId, serviceName, deploymentName, null, null));
 }
 public NewAzureAffinityGroup(IServiceManagement channel)
 {
     Channel = channel;
 }
Example #56
0
 public static void ResumeDeploymentUpdateOrUpgradeBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot)
 {
     proxy.EndResumeDeploymentUpdateOrUpgradeBySlot(proxy.BeginResumeDeploymentUpdateOrUpgradeBySlot(subscriptionId, serviceName, deploymentSlot, null, null));
 }
 public StorageCredentialsFactory(IServiceManagement channel, SubscriptionData currentSubscription)
 {
     this.channel = channel;
     this.currentSubscription = currentSubscription;
 }
Example #58
0
 public static void UpdateDeploymentStatusBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, UpdateDeploymentStatusInput input)
 {
     proxy.EndUpdateDeploymentStatusBySlot(proxy.BeginUpdateDeploymentStatusBySlot(subscriptionId, serviceName, deploymentSlot, input, null, null));
 }
 public StopAzureService(IServiceManagement channel)
     : base(channel)
 {
     Status = DeploymentStatus.Suspended;
 }
Example #60
0
 public static void ChangeConfigurationBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, ChangeConfigurationInput input)
 {
     proxy.EndChangeConfigurationBySlot(proxy.BeginChangeConfigurationBySlot(subscriptionId, serviceName, deploymentSlot, input, null, null));
 }