private string ExtractResourceGroupName(string id) { var idParts = id.Split('/'); if (idParts.Length < 4) { throw new CloudException(String.Format(Resources.MissingResGroupName, id)); } return idParts[4]; } }