Exemplo n.º 1
0
        private Uri UploadPackage(PublishContext context)
        {
            WriteVerboseWithTimestamp(
                Resources.PublishUploadingPackageMessage,
                context.ServiceSettings.StorageServiceName);

            return(CloudBlobUtility.UploadPackageToBlob(
                       StorageClient,
                       context.ServiceSettings.StorageServiceName,
                       context.PackagePath,
                       new BlobRequestOptions()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates new instance from CloudServiceClient.
        /// </summary>
        /// <param name="subscription">The subscription data</param>
        /// <param name="currentLocation">Directory to do operations in</param>
        /// <param name="debugStream">Action used to log http requests/responses</param>
        /// <param name="verboseStream">Action used to log detailed client progress</param>
        /// <param name="warningStream">Action used to log warning messages</param>
        public CloudServiceClient(
            AzureSubscription subscription,
            string currentLocation        = null,
            Action <string> debugStream   = null,
            Action <string> verboseStream = null,
            Action <string> warningStream = null)
            : this(currentLocation, debugStream, warningStream, verboseStream)
        {
            Subscription     = subscription;
            CloudBlobUtility = new CloudBlobUtility();

            ManagementClient = AzureSession.ClientFactory.CreateClient <ManagementClient>(subscription, AzureEnvironment.Endpoint.ServiceManagement);
            StorageClient    = AzureSession.ClientFactory.CreateClient <StorageManagementClient>(subscription, AzureEnvironment.Endpoint.ServiceManagement);
            ComputeClient    = AzureSession.ClientFactory.CreateClient <ComputeManagementClient>(subscription, AzureEnvironment.Endpoint.ServiceManagement);
        }
        /// <summary>
        /// Creates new instance from CloudServiceClient.
        /// </summary>
        /// <param name="subscription">The subscription data</param>
        /// <param name="currentLocation">Directory to do operations in</param>
        /// <param name="debugStream">Action used to log http requests/responses</param>
        /// <param name="verboseStream">Action used to log detailed client progress</param>
        /// <param name="warningStream">Action used to log warning messages</param>
        public CloudServiceClient(
            WindowsAzureSubscription subscription,
            string currentLocation        = null,
            Action <string> debugStream   = null,
            Action <string> verboseStream = null,
            Action <string> warningStream = null)
            : this(currentLocation, debugStream, warningStream, verboseStream)
        {
            Subscription     = subscription;
            CloudBlobUtility = new CloudBlobUtility();

            ManagementClient = subscription.CreateClient <ManagementClient>();
            StorageClient    = subscription.CreateClient <StorageManagementClient>();
            ComputeClient    = subscription.CreateClient <ComputeManagementClient>();
        }
Exemplo n.º 4
0
        internal CloudServiceClient(
            AzureSubscription subscription,
            ManagementClient managementClient,
            StorageManagementClient storageManagementClient,
            ComputeManagementClient computeManagementClient)
            : this((string)null, null, null, null)
        {
            Subscription     = subscription;
            CurrentDirectory = null;
            DebugStream      = null;
            VerboseStream    = null;
            WarningStream    = null;

            CloudBlobUtility = new CloudBlobUtility();
            ManagementClient = managementClient;
            StorageClient    = storageManagementClient;
            ComputeClient    = computeManagementClient;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Creates new instance from CloudServiceClient.
 /// </summary>
 /// <param name="subscription">The subscription data</param>
 /// <param name="debugStream">Action used to log http requests/responses</param>
 /// <param name="verboseStream">Action used to log detailed client progress</param>
 /// <param name="warningStream">Action used to log warning messages</param>
 public CloudServiceClient(
     SubscriptionData subscription,
     string currentLocation        = null,
     Action <string> debugStream   = null,
     Action <string> verboseStream = null,
     Action <string> warningStream = null)
 {
     Subscription             = subscription;
     subscriptionId           = subscription.SubscriptionId;
     CurrentDirectory         = currentLocation;
     DebugStream              = debugStream;
     VerboseStream            = verboseStream;
     WarningeStream           = warningStream;
     HeadersInspector         = new HeadersInspector();
     ServiceManagementChannel = ServiceManagementHelper.CreateServiceManagementChannel <IServiceManagement>(
         ConfigurationConstants.WebHttpBinding(),
         new Uri(subscription.ServiceEndpoint),
         subscription.Certificate,
         new HttpRestMessageInspector(DebugStream),
         HeadersInspector);
     CloudBlobUtility = new CloudBlobUtility();
 }
        internal CloudServiceClient(
            WindowsAzureSubscription subscription,
            ManagementClient managementClient,
            StorageManagementClient storageManagementClient,
            ComputeManagementClient computeManagementClient)
            : this((string)null, null, null, null)
        {
            Subscription = subscription;
            CurrentDirectory = null;
            DebugStream = null;
            VerboseStream = null;
            WarningStream = null;

            CloudBlobUtility = new CloudBlobUtility();
            ManagementClient = managementClient;
            StorageClient = storageManagementClient;
            ComputeClient = computeManagementClient;
        }
        /// <summary>
        /// Creates new instance from CloudServiceClient.
        /// </summary>
        /// <param name="subscription">The subscription data</param>
        /// <param name="currentLocation">Directory to do operations in</param>
        /// <param name="debugStream">Action used to log http requests/responses</param>
        /// <param name="verboseStream">Action used to log detailed client progress</param>
        /// <param name="warningStream">Action used to log warning messages</param>
        public CloudServiceClient(
            WindowsAzureSubscription subscription,
            string currentLocation = null,
            Action<string> debugStream = null,
            Action<string> verboseStream = null,
            Action<string> warningStream = null)
            : this(currentLocation, debugStream, warningStream, verboseStream)
        {
            Subscription = subscription;
            CloudBlobUtility = new CloudBlobUtility();

            ManagementClient = subscription.CreateClient<ManagementClient>();
            StorageClient = subscription.CreateClient<StorageManagementClient>();
            ComputeClient = subscription.CreateClient<ComputeManagementClient>();
        }