Microsoft.Azure.Commands.Compute.StorageServices.StorageCredentialsFactory.IsChannelRequired C# (CSharp) Method

IsChannelRequired() public static method

public static IsChannelRequired ( Uri destination ) : bool
destination System.Uri
return bool
        public static bool IsChannelRequired(Uri destination)
        {
            return String.IsNullOrEmpty(destination.Query);
        }

Usage Example

Example #1
0
        private StorageCredentialsFactory CreateStorageCredentialsFactory()
        {
            StorageCredentialsFactory storageCredentialsFactory;

            var storageClient = AzureSession.ClientFactory.CreateArmClient <StorageManagementClient>(
                DefaultProfile.Context, AzureEnvironment.Endpoint.ResourceManager);

            if (StorageCredentialsFactory.IsChannelRequired(Destination))
            {
                storageCredentialsFactory = new StorageCredentialsFactory(this.ResourceGroupName, storageClient, DefaultContext.Subscription);
            }
            else
            {
                storageCredentialsFactory = new StorageCredentialsFactory();
            }

            return(storageCredentialsFactory);
        }