Пример #1
0
        /// <summary>
        /// Creates a new storage account given a name and location
        /// </summary>
        public void CreateNewStorageAccount(string name, string location       = LocationConstants.NorthEurope
                                            , StorageManagementOptions options = null)
        {
            if (options == null)
            {
                options = StorageManagementOptions.GetDefaultOptions;
            }

            // issue the create storage account command
            var create = new CreateStorageAccountCommand(name, "Created with Fluent Management", options, location)
            {
                SubscriptionId = SubscriptionId,
                Certificate    = ManagementCertificate
            };

            create.Execute();
            var status = StorageStatus.Creating;

            while (status != StorageStatus.Created)
            {
                var command = new GetStorageAccountStatusCommand(name)
                {
                    SubscriptionId = SubscriptionId,
                    Certificate    = ManagementCertificate
                };
                command.Execute();
                status = command.Status;
            }
        }
Пример #2
0
        public void CreateNewStorageAccount(string name, string location = "North Europe")
        {
            // issue the create storage account command
            var create = new CreateStorageAccountCommand(name, "Created with Fluent Management", location)
            {
                SubscriptionId = SubscriptionId,
                Certificate    = ManagementCertificate
            };

            create.Execute();
        }