public ChangeRolePermissions ( |
||
role | ||
return | void |
internal string AddAzureNodeWorkerRoleProcess(string workerRoleName, int instances, string rootPath) { string result; AzureService service = new AzureService(rootPath, null); RoleInfo workerRole = service.AddWorkerRole(Resources.NodeScaffolding, workerRoleName, instances); try { service.ChangeRolePermissions(workerRole); } catch (UnauthorizedAccessException) { SafeWriteObject(Resources.AddRoleMessageInsufficientPermissions); SafeWriteObject(Environment.NewLine); } result = string.Format(Resources.AddRoleMessageCreate, rootPath, workerRole.Name); return result; }
public override void ExecuteCmdlet() { RootPath = RootPath ?? General.GetServiceRootPath(CurrentPath()); AzureService service = new AzureService(RootPath, null); RoleInfo roleInfo = null; if (isWebRole) { roleInfo = service.AddWebRole(Scaffolding, Name, Instances); } else { roleInfo = service.AddWorkerRole(Scaffolding, Name, Instances); } OnProcessing(roleInfo); try { service.ChangeRolePermissions(roleInfo); SafeWriteOutputPSObject(typeof(RoleSettings).FullName, Parameters.RoleName, roleInfo.Name); WriteVerbose(string.Format(successMessage, RootPath, roleInfo.Name)); } catch (UnauthorizedAccessException) { WriteWarning(Resources.AddRoleMessageInsufficientPermissions); } }