public static void UpdateStorageAccount(this IServiceManagement proxy, string subscriptionId, string storageAccountName, string label, string description)
        {
            var input = new UpdateStorageServiceInput()
            {
                Label       = ServiceManagementHelper.EncodeToBase64String(label),
                Description = description
            };

            proxy.EndUpdateStorageAccount(proxy.BeginUpdateStorageAccount(subscriptionId, storageAccountName, input, null, null));
        }
Exemple #2
0
        public DeploymentInfoContext(Deployment innerDeployment)
        {
            this.innerDeployment = innerDeployment;

            if (this.innerDeployment.RoleInstanceList != null)
            {
                this.RoleInstanceList = new List <Microsoft.WindowsAzure.Management.CloudService.Concrete.RoleInstance>();
                foreach (var roleInstance in this.innerDeployment.RoleInstanceList)
                {
                    this.RoleInstanceList.Add(new Microsoft.WindowsAzure.Management.CloudService.Concrete.RoleInstance(roleInstance));
                }
            }

            if (!string.IsNullOrEmpty(this.innerDeployment.Configuration))
            {
                string xmlString = ServiceManagementHelper.DecodeFromBase64String(this.innerDeployment.Configuration);

                XDocument doc = null;
                using (var stringReader = new StringReader(xmlString))
                {
                    XmlReader reader = XmlReader.Create(stringReader);
                    doc = XDocument.Load(reader);
                }

                this.OSVersion = doc.Root.Attribute("osVersion") != null?
                                 doc.Root.Attribute("osVersion").Value:
                                 string.Empty;

                this.RolesConfiguration = new Dictionary <string, RoleConfiguration>();

                var roles = doc.Root.Descendants(this.ns + "Role");

                foreach (var role in roles)
                {
                    this.RolesConfiguration.Add(role.Attribute("name").Value, new RoleConfiguration(role));
                }
            }
        }
Exemple #3
0
        public static string GetConfiguration(string configurationPath)
        {
            var configuration = string.Join(string.Empty, File.ReadAllLines(configurationPath));

            return(ServiceManagementHelper.EncodeToBase64String(configuration));
        }