private void AddNewRole(ServiceConfiguration sc, RoleSettings newRole)
        {
            int count = (sc.Role == null) ? 0 : sc.Role.Length;
            RoleSettings[] roleSettings = new RoleSettings[count + 1];

            if (count > 0)
            {
                sc.Role.CopyTo(roleSettings, 0);
            }
            roleSettings[count] = newRole;
            sc.Role = roleSettings;
        }
        private string SetAzureCouchStorageAccountProcess(string rootPath)
        {
            InitializeArgs(rootPath);
            if (!StorageAccountExists(this.StorageAccountName))
            {
                CreateStorageAccount(this.StorageAccountName.ToLower(), this.StorageAccountName.ToLower(), azureService.Components.Settings.Location, this.AffinityGroup);
                WriteObject(string.Format(Resources.AzureStorageAccountCreatedMessage, this.StorageAccountName));
            }
            else
            {
                WriteObject(string.Format(Resources.AzureStorageAccountAlreadyExistsMessage, this.StorageAccountName));
            }

            session = Session.GetSession(SessionState.Path.ParseParent(rootPath, null), false);
            serviceDefinitionFileName = General.Instance.SvcDefinitionFilePath(rootPath);
            cloudSvcConfigFileName = General.Instance.CloudSvcConfigFilePath(rootPath);

            // Loading *.cscfg and *csdef files
            cloudSvcConfig = General.Instance.ParseFile<ServiceConfiguration>(cloudSvcConfigFileName);
            svcDef = General.Instance.ParseFile<ServiceDefinition>(serviceDefinitionFileName);

            GetRoleOccurrence(svcDef, out webRoleOccurrence, out workerRoleOccurrence);
            ConfigureRoleStorageAccountKeys();

            return string.Format(Resources.AzureStorageAccountConfiguredForCouchRoleMessage, this.StorageAccountName.ToLower(), this.CouchDBRoleName);
        }