public static string GetDeploymentFromId(string id)
{
var segments = id.Split('/');
if (segments.Count() < 6 || !(segments[5].Equals("deployments", StringComparison.InvariantCultureIgnoreCase)) || segments[6].Length == 0)
{
throw new InvalidOperationException("There is not a vaild deployment present in this Id");
}
return segments[6];
}